J
Jana
I want to open a Word document via a command button on an
Access form. I'm using Access 2000. So far I've created
the command button with the following code:
Private Sub GdBkdoc1_Click()
On Error GoTo Err_GdBkdoc1_Click
Dim oWordFile As Object
Set oWordFile = GetObject
("c:\test.doc", "Word.Application")
oWordFile.Visible = True
Exit_GdBkdoc1_Click:
Exit Sub
Err_GdBkdoc1_Click:
MsgBox Err.Description
Resume Exit_GdBkdoc1_Click
End Sub
I receive the following error when the function runs:
Filename or class name not found during Automation
operation.
If I take out the filename in the above code, Word opens
fine.
What am I missing? All help will be appreciated!!
Thanks,
Jana
Access form. I'm using Access 2000. So far I've created
the command button with the following code:
Private Sub GdBkdoc1_Click()
On Error GoTo Err_GdBkdoc1_Click
Dim oWordFile As Object
Set oWordFile = GetObject
("c:\test.doc", "Word.Application")
oWordFile.Visible = True
Exit_GdBkdoc1_Click:
Exit Sub
Err_GdBkdoc1_Click:
MsgBox Err.Description
Resume Exit_GdBkdoc1_Click
End Sub
I receive the following error when the function runs:
Filename or class name not found during Automation
operation.
If I take out the filename in the above code, Word opens
fine.
What am I missing? All help will be appreciated!!
Thanks,
Jana