D
Domw001
I have created a word doc that has a mail merge connection to an Access table.
When I open the doc from Windows Explorer I get the prompt "Data from
database will be placed in the document. Continue?"
However when I open the doc from a form button i do not get this prompt and
I have to run the Open Data Source procedure.
I use the following code:
Dim LWordDoc As String
Dim oApp As Object
'Path to the word document
LWordDoc = "C:\mail_merge.doc"
If Dir(LWordDoc) = "" Then
MsgBox "Document not found."
Else
'Create an instance of MS Word
Set oApp = CreateObject(Class:="Word.Application")
oApp.Visible = True
'Open the Document
oApp.Documents.Open filename:=LWordDoc
End If
Am I missing something?
When I open the doc from Windows Explorer I get the prompt "Data from
database will be placed in the document. Continue?"
However when I open the doc from a form button i do not get this prompt and
I have to run the Open Data Source procedure.
I use the following code:
Dim LWordDoc As String
Dim oApp As Object
'Path to the word document
LWordDoc = "C:\mail_merge.doc"
If Dir(LWordDoc) = "" Then
MsgBox "Document not found."
Else
'Create an instance of MS Word
Set oApp = CreateObject(Class:="Word.Application")
oApp.Visible = True
'Open the Document
oApp.Documents.Open filename:=LWordDoc
End If
Am I missing something?