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 / Programming / June 2007

Tip: Looking for answers? Try searching our database.

Word Mail Merge and Printer Zooming!

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
fmbright - 31 May 2007 21:43 GMT
Is it possible to have a macro control the printer zooming after the mail
merge is done??  We are having problems merging labels with our macro.  It
now crops the printout to show only 12 of 14 inches on a US fan fold.  We can
manually set the zoom to make the print go across the page.  But want to
automate our macro to do the zooming.

Any ideas on how to change the zoom once the mail merge is done??

Below is a copy of the script and what we tried!

Thanks!

FMB

-------------------------------------------------------------------
Sub xlabel1()

   Documents.Open FileName:="xlabel.doc", ConfirmConversions:=False, _
       ReadOnly:=False, AddToRecentFiles:=False, PasswordDocument:="", _
       PasswordTemplate:="", Revert:=False, WritePasswordDocument:="", _
       WritePasswordTemplate:="", Format:=wdOpenFormatAuto
       
   ActivePrinter = "\\host1\ibmProprinterXL"
   
   With ActiveDocument.MailMerge
       .Destination = wdSendToNewDocument
       .MailAsAttachment = False
       .MailAddressFieldName = ""
       .MailSubject = ""
       .SuppressBlankLines = True
       With .DataSource
           .FirstRecord = wdDefaultFirstRecord
           .LastRecord = wdDefaultLastRecord
       End With
       .Execute Pause:=True
   End With
   
   ' print
   
   Application.PrintOut FileName:="", Range:=wdPrintAllDocument, Item:= _
       wdPrintDocumentContent, Copies:=1, Pages:="",
PageType:=wdPrintAllPages, _
       ManualDuplexPrint:=False, Collate:=True, Background:=True,
PrintToFile:= _
       False, PrintZoomColumn:=0, PrintZoomRow:=0,
PrintZoomPaperWidth:=21420, _
       PrintZoomPaperHeight:=0
       
   ActiveDocument.Close savechanges:=wdDoNotSaveChanges

End Sub

Signature

---------
fm.bright@hotmial.com

Peter Jamieson - 02 Jun 2007 10:58 GMT
If the problem is that you can't work out how to reference the document you
created usiong the Execute statement, after the merge the "destination"
document is the ActiveDocument (assuming no error document was created), so
you probably need to use

ActiveDocument.PrintOut

etc.

FWIW I usually set a reference to the /original/ ActiveDocument before
executing the merge, e.g.

Dim objMMMD As Word.Document
Set objMMMD = ActiveDcoument

That way you can still do stuff to your mail merge main document post-merge.

If the problem is that the Zooming does not do what you need, sorry, I can't
really help you there. Interesting approach though - I will be interested to
know if you get it to work. (I've had a look at problems with printing to
dot matrix printers from Word 2002 and later in the past and found that Word
sometimes does not produce the printer escape codes that it should).

Peter Jamieson

> Is it possible to have a macro control the printer zooming after the mail
> merge is done??  We are having problems merging labels with our macro.  It
[quoted text clipped - 48 lines]
>
> End Sub
 
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.