J
jbc
Hello,
I have a template that I created several years ago. I'm now using it in
Word 2003 that merges with a query in Access 2003. I recorded the merging
process and am getting 2 prompts that I would rather not get.
I want to be able to double click on the word template and have the macro
merge the template with the access query.
The prompts are: Opening this document will run the following SQL command.
Select *From[qryLetterNewMember] Data from your database will be placed in
the document. Do you want to continue? YES NO
Confirm Data Source: I choose MS Access Database via DDE *.mdb *.mde
this is the code:
ActiveDocument.MailMerge.OpenDataSource Name:= _
"C:\xxxxx\Membership.mdb" _
, ConfirmConversions:=False, ReadOnly:=False, LinkToSource:=True, _
AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:="", _
WritePasswordDocument:="", WritePasswordTemplate:="", Revert:=False, _
Format:=wdOpenFormatAuto, Connection:="QUERY qryLetterNewMember", _
SQLStatement:="SELECT * FROM [qryLetterNewMember]",
SQLStatement1:="", _
SubType:=wdMergeSubTypeOther
With ActiveDocument.MailMerge
.Destination = wdSendToNewDocument
.Execute
End With
What am I doing wrong? Thanks.
jbc
I have a template that I created several years ago. I'm now using it in
Word 2003 that merges with a query in Access 2003. I recorded the merging
process and am getting 2 prompts that I would rather not get.
I want to be able to double click on the word template and have the macro
merge the template with the access query.
The prompts are: Opening this document will run the following SQL command.
Select *From[qryLetterNewMember] Data from your database will be placed in
the document. Do you want to continue? YES NO
Confirm Data Source: I choose MS Access Database via DDE *.mdb *.mde
this is the code:
ActiveDocument.MailMerge.OpenDataSource Name:= _
"C:\xxxxx\Membership.mdb" _
, ConfirmConversions:=False, ReadOnly:=False, LinkToSource:=True, _
AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:="", _
WritePasswordDocument:="", WritePasswordTemplate:="", Revert:=False, _
Format:=wdOpenFormatAuto, Connection:="QUERY qryLetterNewMember", _
SQLStatement:="SELECT * FROM [qryLetterNewMember]",
SQLStatement1:="", _
SubType:=wdMergeSubTypeOther
With ActiveDocument.MailMerge
.Destination = wdSendToNewDocument
.Execute
End With
What am I doing wrong? Thanks.
jbc