Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
hlock hlock is offline
external usenet poster
 
Posts: 3
Default 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   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Cindy M. Cindy M. is offline
external usenet poster
 
Posts: 2,416
Default 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

Posting Rules

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Print 2 half-sheet mail merge docs on one sheet of paper Sue Microsoft Word Help 7 April 27th 23 08:49 AM
Print preview shoud reflect all chosen print options Cooz Microsoft Word Help 1 March 10th 06 04:19 PM
office 2003 add a button to a toolbar should actually WORK Tenna Microsoft Word Help 1 December 28th 05 04:15 AM
How do I delete files from the "Work" Built-In Menu button? Jedi Word Apprentice Microsoft Word Help 2 February 9th 05 10:13 PM
How can I print 3 merge documents per page? TML - Boone Mailmerge 1 December 11th 04 09:11 PM


All times are GMT +1. The time now is 05:35 PM.

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"