Word does not present mail merge prompt from Form button

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top