Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Print Button does not work after Merge
I created a print button on my document using the technique from
http://word.mvps.org/FAQs/TblsFldsFm...rintButton.htm. The code is located in Visual Basic/Project (Name)/Microsoft Word Objects/ThisDocument. However, my document contains merge fields and after it is merged with my data from access, the print button no longer works. How do I carry over the code from the original document to the merged document. I am wanting a button to print the entire document PLUS 2 copies of page 2. Thanks for any help. |
#2
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Print Button does not work after Merge
Hi ?B?aGxvY2s=?=,
I created a print button on my document using the technique from http://word.mvps.org/FAQs/TblsFldsFm...rintButton.htm. The code is located in Visual Basic/Project (Name)/Microsoft Word Objects/ThisDocument. However, my document contains merge fields and after it is merged with my data from access, the print button no longer works. How do I carry over the code from the original document to the merged document. I am wanting a button to print the entire document PLUS 2 copies of page 2. The simplest approach would probably be 1. Create a TEMPLATE (*.dot) from which you'll generate a main merge document each time you need one. 2. Create and save a toolbar in this template (Tools/Customize/Toolbars) 3. Insert a Module into this templates VBA project and copy your macro code into that 4. Drag this macro into the new toolbar (Tools/Customize/Commands; Category:Macro) 5. Create another macro to execute the mail merge. At the end of the mail merge, the macro needs to attach the template to the mail merge result, so that the toolbar with the button will be available. Something like this: Sub ExecuteMerge() Dim doc as Word.Document Set doc = ActiveDocument If doc.MailMerge.MainDocumentType wdNotAMergeDocument doc.MailMerge.Execute ActiveDocument.AttachedTemplate = "C:\Full path\TemplateName.dot" ENd If End Sub 6. Put this macro on the toolbar, as well. Cindy Meister INTER-Solutions, Switzerland http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005) http://www.word.mvps.org This reply is posted in the Newsgroup; please post any follow question or reply in the newsgroup and not by e-mail :-) |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Print 2 half-sheet mail merge docs on one sheet of paper | Microsoft Word Help | |||
Print preview shoud reflect all chosen print options | Microsoft Word Help | |||
office 2003 add a button to a toolbar should actually WORK | Microsoft Word Help | |||
How do I delete files from the "Work" Built-In Menu button? | Microsoft Word Help | |||
How can I print 3 merge documents per page? | Mailmerge |