Results 1 to 3 of 3

Thread: [RESOLVED] Open word and close word document late bound

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2005
    Posts
    393

    Resolved [RESOLVED] Open word and close word document late bound

    Hi,

    How do I open and close a word document late bound style in vb6.0.
    with error checking.


    Cheers,

  2. #2
    Fanatic Member Comintern's Avatar
    Join Date
    Nov 2004
    Location
    Lincoln, NE
    Posts
    826

    Re: Open word and close word document late bound

    Something like this:
    VB Code:
    1. Dim oWord As Object, oDoc As Object
    2.    
    3.     On Error Resume Next
    4.    
    5.     Set oWord = CreateObject("Word.Application")        'Open Word.
    6.     If Err.Number <> 0 Then
    7.         Debug.Print "Problem opening Word."
    8.         Exit Sub
    9.     Else
    10.         Set oDoc = oWord.documents.Open("D:\word.doc")  'Open a document.
    11.         If Err.Number <> 0 Then
    12.             Debug.Print "Problem opening document."
    13.         Else
    14.             'Work with document.
    15.             oDoc.Close                                  'Close the document.
    16.             oWord.Quit                                  'Quit the application.
    17.         End If
    18.     End If

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2005
    Posts
    393

    Re: Open word and close word document late bound

    Cheers expert Comitern!!!!!!Hey any ideas with my line up table of two table posts! The idea after achieving the line up with each table is:-

    via if formulas match each field with each table but 1st I need to sort out the line up rountine.


    Cheers buddy!
    Last edited by gphillips; Oct 20th, 2006 at 03:33 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width