K
kheisler6
When I open a Word document, an AutoOpen Macro automatically connects
to a parameter query in an Access database, prompts the user for a Last
Name, and then executes the merge. Both the original merge template and
the final merged document stay open.
How can I let the user return to the original merge template and rerun
the merge (maybe with a keystroke combination), this time entering a
different Last Name at the prompt?
Thank you. Code below.
Kurt
###
Sub AutoOpen()
'Start a new main document for the mail merge.
With MainDoc.MailMerge
.MainDocumentType = wdCatalog
.OpenDataSource Name:="G:\Work\PM\PM.mdb", _
Connection:= _
"QUERY qryManuscripts", _
SQLStatement:= _
"SELECT * FROM [qryManuscripts]", _
SQLStatement1:="", _
SubType:=wdMergeSubTypeWord2000
End With
MainDoc.MailMerge.Execute
to a parameter query in an Access database, prompts the user for a Last
Name, and then executes the merge. Both the original merge template and
the final merged document stay open.
How can I let the user return to the original merge template and rerun
the merge (maybe with a keystroke combination), this time entering a
different Last Name at the prompt?
Thank you. Code below.
Kurt
###
Sub AutoOpen()
'Start a new main document for the mail merge.
With MainDoc.MailMerge
.MainDocumentType = wdCatalog
.OpenDataSource Name:="G:\Work\PM\PM.mdb", _
Connection:= _
"QUERY qryManuscripts", _
SQLStatement:= _
"SELECT * FROM [qryManuscripts]", _
SQLStatement1:="", _
SubType:=wdMergeSubTypeWord2000
End With
MainDoc.MailMerge.Execute