G
Guest
I have created a new command button on a form which I would like to open a
word document with. This is the code I have put in when creating the
cmdButton
Private Sub cmdReport1_Click()
On Error GoTo Err_cmdReport1_Click
Dim oApp As Object
Set oApp = CreateObject("Word.Application")
oApp.Visible = True
Exit_cmdReport1_Click:
Exit Sub
Err_cmdReport1_Click:
MsgBox Err.Description
Resume Exit_cmdReport1_Click
End Sub
This opens word like a dream but how do I point it to my document so that
when the application opens it opens with the document.
For this exercise lets just say the document name I wish to open is TEST.DOC
and is located at c:\database\word\TEST.DOC.
Thanks in advance and I am going to post this same message in Forms coding
as I am not sure which group to go to on this question.
word document with. This is the code I have put in when creating the
cmdButton
Private Sub cmdReport1_Click()
On Error GoTo Err_cmdReport1_Click
Dim oApp As Object
Set oApp = CreateObject("Word.Application")
oApp.Visible = True
Exit_cmdReport1_Click:
Exit Sub
Err_cmdReport1_Click:
MsgBox Err.Description
Resume Exit_cmdReport1_Click
End Sub
This opens word like a dream but how do I point it to my document so that
when the application opens it opens with the document.
For this exercise lets just say the document name I wish to open is TEST.DOC
and is located at c:\database\word\TEST.DOC.
Thanks in advance and I am going to post this same message in Forms coding
as I am not sure which group to go to on this question.