Opening and closing a word doc.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am opening a word doc from a access form. How can I manage to close that
word doc from access too?


Jokobe
 
Try

Function Open_WordDoc()

Dim objWord As Word.Application
Dim objDoc As Word.Document
Dim DocPath As String

DocPath = "c:\DocNames.doc"

Set objWord = New Word.Application
Set objDoc = objWord.Documents.Open(DocPath)

objDoc.Activate
objDoc.PrintOut ' To print out
objWord.Visible = True ' To display
objWord.Quit ' To close
End Function
 
The trouble is here:
Set objDoc = objWord.Documents.Open(DocPath)
I open the doc with a simiple link (the user clicks on the link, word opens
with the document).

When trying to close with objword.documents.close the is no
argument for the document name.
 
Back
Top