Open Word

  • Thread starter Thread starter David W
  • Start date Start date
D

David W

how do you check for an existing document in Word 2003 from a command button
then if it is present open it?
 
If you know where the document should be, you can use the Dir() function to
check whether it's there.
If you just want to open it in word, look at ShellExecute.
 
Hi David.

Set WD = CreateObject("Word.Document")
myDoc = CurrentProject.Path & "\XY.doc" -if it's in the same folder
otherwise write full path

Set DC = Word.Documents.Add(myDoc , , , True)
DC.ActiveWindow.Visible = True

Cheers,
Gina
 
Back
Top