Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2002
    Location
    Silver Spring, Maryland
    Posts
    74

    Unanswered: How do I keep MS Word open when opened by MS Access

    How do I keep MS Word open when opened by MS Access

    I am writing an MS Access application. This code snippet just opens MS world and closes immediately. This is not what I want. I want to be able to leave it open long enough to edit it.

    Dim objWord As Word.Application



    Function OpenAWord_Maybenot(wordDocStr As String)

    If TypeName(objWord) <> "Application" Then

    'Start Microsoft Word 97.
    Set objWord = CreateObject("Word.Application")

    objWord.Visible = True
    objWord.Documents.Open (wordDocStr)


    'Quit Microsoft Word and release the object variable.
    objWord.Quit
    Set objWord = Nothing

    End If

    End Function

  2. #2
    Join Date
    Nov 2002
    Location
    San Francisco
    Posts
    251
    dude,

    if you won't call QUIT method, it will keep MS Word opened!

    remove objWord.Quit


    jiri

  3. #3
    Join Date
    Feb 2002
    Location
    Silver Spring, Maryland
    Posts
    74
    Thanks. It worked.

Posting Permissions

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