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 / February 2008

Tip: Looking for answers? Try searching our database.

Using the PrintOut Method via VBA in Microsoft Word.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kevin E. - 12 Feb 2008 14:53 GMT
I have a Word Document setup with a bunch of Label Controls placed in the
Body of the Document.  I have a macro setup that takes information from an
excel spreadsheet and fills the labels with text...and then prints the
document...everything worked fine when I first created the document and
program but now the print method is broken.  When i start the macro, i open
the printer properties window and see that the documents are being
spooled...and when the macro finishes the printer deletes the documents from
the printer que...does anybody know why this is happening.  At the begining
of my project i started printing about ten documents...now i am only trying
to print two documents...After the macro ends the document closes...am i
quitting the program too soon so that all the printing information being sent
to the printer doesnt quite get there in all of its entirety with only two
documents being printed as opposed to ten.  

here is the printer code that i am using, i inserted a pause for the
document to spool and print before going to the next document to print but it
didnt work the way i thought it would because watching the printer properties
window i see all documents spool until the macro finishes and then they all
begin to print (when everything was working properly):

wrdDocument.PrintOut
       PauseTime = 20
       Start = Timer
       Do While Timer < Start + PauseTime
           DoEvents
       Loop
Doug Robbins - Word MVP - 12 Feb 2008 19:55 GMT
Try setting the Background attribute of the PrintOut command to False so
that execution of the balance of the macro commands is delayed until the
printing (at least spooling) has been completed.

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

>I have a Word Document setup with a bunch of Label Controls placed in the
> Body of the Document.  I have a macro setup that takes information from an
[quoted text clipped - 30 lines]
>            DoEvents
>        Loop
 
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.