Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / August 2006

Tip: Looking for answers? Try searching our database.

Print Button does not work after Merge

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
hlock - 09 Aug 2006 20:26 GMT
I created a print button on my document using the technique from
http://word.mvps.org/FAQs/TblsFldsFms/HidePrintButton.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.
Cindy M. - 10 Aug 2006 09:31 GMT
Hi =?Utf-8?B?aGxvY2s=?=,

> I created a print button on my document using the technique from
> http://word.mvps.org/FAQs/TblsFldsFms/HidePrintButton.htm.  The code is
[quoted text clipped - 5 lines]
> 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 :-)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.