L
LDanix
I'm am trying to get a button on a form to open a Word document. I works in
one database, but not in a second that has tables linked to the first. Both
databases are accessing the same .doc, at different times. Here's my code for
the button on the second database:
Private Sub cmdGenerateAddressList_Click()
Dim wordDoc As String
Dim oapp As Object
Set oapp = CreateObject(Class:="Word.Application")
oapp.Visible = True
wordDoc = filePath & "CurrentEmployeeAddressListPam.doc"
oapp.Documents.Open FileName:=wordDoc
End Sub
The debugger highlights "oapp.Documents.Open FileName:=wordDoc"
What am I doing wrong?
Thanks
one database, but not in a second that has tables linked to the first. Both
databases are accessing the same .doc, at different times. Here's my code for
the button on the second database:
Private Sub cmdGenerateAddressList_Click()
Dim wordDoc As String
Dim oapp As Object
Set oapp = CreateObject(Class:="Word.Application")
oapp.Visible = True
wordDoc = filePath & "CurrentEmployeeAddressListPam.doc"
oapp.Documents.Open FileName:=wordDoc
End Sub
The debugger highlights "oapp.Documents.Open FileName:=wordDoc"
What am I doing wrong?
Thanks