Results 1 to 2 of 2

Thread: Open mulitple documents in Word

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Location
    Dallas, TX
    Posts
    1
    I can open multiple instances of Word from VB, but I can't figure out how to open one instance of Word and have multiple documents open.

    How can that be done?

  2. #2
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    Try using GetObject instead of CreateObject.
    Code:
    Private wrd As Word.Application
    
    Private Sub OpenDoc(sFileName As String)
        On Error Resume Next
        Set wrd = GetObject(, "Word.Application")
        If Err Then
            'an error has been raised, assuming Word is not started
            Set wrd = CreateObject("Word.Application")
        End If
        'the rest of the code
    End Sub
    Good luck!

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