Open Word

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?
 
M

MacDermott

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.
 
G

Gina

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
 
Top