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 / September 2004

Tip: Looking for answers? Try searching our database.

print problem after merge

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mike Molyneaux - 21 Sep 2004 20:45 GMT
Office 2003, Xp Pro SP1.

User has macro to merge data to document, then print same.

Works fine.

Cannot then print from Excel unless restart computer.

Excel creates file named some number of squares with no
file size.

Here's macro:

Sub mergeLabels()

   Application.ScreenUpdating = False
   Application.DisplayAlerts = wdAlertsNone
 
   Documents.Open FileName:= _
       """n:\file transfers\payroll\master 2 by 20
labels.doc""", _
       ConfirmConversions:=False, _
       ReadOnly:=False, _
       AddToRecentFiles:=False, _
       PasswordDocument:="", _
       PasswordTemplate:="", _
       Revert:=False, _
       WritePasswordDocument:="", _
       WritePasswordTemplate:="", _
       Format:=wdOpenFormatAuto

   ActiveDocument.MailMerge.OpenDataSource Name:= _
       "N:\File Transfers\Payroll\nprf0432.dat", _
       ConfirmConversions:=False, _
       ReadOnly:=False, _
       LinkToSource:=True, _
       AddToRecentFiles:=False, _
       PasswordDocument:="", _
       PasswordTemplate:="", _
       WritePasswordDocument:="", _
       WritePasswordTemplate:="", _
       Revert:=False, _
       Format:=wdOpenFormatAuto, _
       Connection:="", _
       SQLStatement:="", _
       SQLStatement1:="", _
       SubType:= _
       wdMergeSubTypeOther
   
   With ActiveDocument.MailMerge
       .Destination = wdSendToNewDocument
       .SuppressBlankLines = True
       With .DataSource
           .FirstRecord = wdDefaultFirstRecord
           .LastRecord = wdDefaultLastRecord
       End With
       .Execute Pause:=False
   End With
   
   ActiveDocument.SaveAs FileName:= _
       """n:\file transfers\payroll\print 2 by 20
labels.doc""", _
       FileFormat:=wdFormatDocument, _
       LockComments:=False, _
       Password:="", _
       AddToRecentFiles:=True, _
       WritePassword:="", _
       ReadOnlyRecommended:=False, _
       EmbedTrueTypeFonts:=False, _
       SaveNativePictureFormat:=False, _
       SaveFormsData:=False, _
       SaveAsAOCELetter:=False
       
   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:=0, _
       PrintZoomPaperHeight:=0
       
   ActiveDocument.Save
   ActiveDocument.Close
   
   ActiveDocument.Save
   ActiveDocument.Close
   
   Application.ScreenUpdating = True
   Application.DisplayAlerts = wdAlertsAll
 
   
End Sub

Am I missing a command or something?

Thanks - Mike
Doug Robbins - 22 Sep 2004 00:03 GMT
Try:

ActiveDocument.PrintOut Background:=False

in place of:

   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:=0, _
       PrintZoomPaperHeight:=0

I think that there might be a timing issue that setting the Background
parameter to false may prevent as the balance of the code will not then run
until the print job is finished.

Signature

Please respond to the Newsgroup for the benefit of others who may be
interested.   Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP

> Office 2003, Xp Pro SP1.
>
[quoted text clipped - 95 lines]
>
> Thanks - Mike
- 22 Sep 2004 15:36 GMT
this change did not fix the problem - thanks anyway

>-----Original Message-----
>Try:
[quoted text clipped - 18 lines]
>parameter to false may prevent as the balance of the code will not then run
>until the print job is finished.

Rate this thread:






 
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.