Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
 
Posts: n/a
Default Allow user to rerun merge using different parameter criteria

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

  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
macropod
 
Posts: n/a
Default Allow user to rerun merge using different parameter criteria

Hi Kurt,

If you press Alt-F8 after returning to the original merge document, you
should be able to select and re-run the AutoOpen macro (unless it's been
hidden).

You could automate the process by adding a MACROBUTTON field to the original
merge document, coded as:
{MACROBUTTON AutoOpen Run Again}
where the field braces (ie '{}') are created as a pair via Ctrl-F9. If you
then format the field's font as hidden text and make sure the 'hidden text'
option is unchecked under Tools|Options|Print, that should complete the
task.

Cheers


wrote in message
oups.com...
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



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
User Merge Field Jo Davis Mailmerge 6 August 9th 07 09:43 PM
merge word with an access query with a like criteria Salli Mailmerge 1 December 1st 05 10:35 PM
Mail merge with Access DB does not see a query SarahB Mailmerge 8 November 29th 05 07:18 PM
Mail Merge: Can't find Outlook 2003 contacts in Power User accou Santao Mailmerge 1 June 19th 05 06:52 AM
Mail Merge - Parameter prompts twice... TL Mailmerge 6 June 17th 05 02:58 PM


All times are GMT +1. The time now is 08:08 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"