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 2007

Tip: Looking for answers? Try searching our database.

Forcing execution of an event....

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Atlas - 02 Feb 2007 18:11 GMT
Hy there,
I wrote a very simple macro to automate printing of a document and as the
"Manual Duplex" printing option isn't working properly, I'd like to handle
with VBA everything.

So what I did is to issue 2 Application.PrintOut calls, separated by a
msgbox call.

Unfortunatelly, the print doesn't begin until the sub is exited....

Any clue on how to execute immediately the first Application.PrintOut call?

Thanks

Here's the code:

Sub PrintDuplex()

   Call SetPrinterProperty(DM_PAPERSIZE, DMPAPER_A3)
   Call SetPrinterProperty(DM_PRINTQUALITY, 1200)

   ActivePrinter = "\\ACRUX\Kyocera Mita KM-1650 (KPDL)"

   Application.PrintOut FileName:="", Range:=wdPrintRangeOfPages, Item:= _
       wdPrintDocumentContent, Copies:=1, Pages:="4,1", PageType:= _
       wdPrintAllPages, ManualDuplexPrint:=False, Collate:=True,
Background:= _
       True, PrintToFile:=False, PrintZoomColumn:=2, PrintZoomRow:=1, _
       PrintZoomPaperWidth:=0, PrintZoomPaperHeight:=0

MsgBox "Turn paper sheet and press Ok when ready", vbOKOnly

 Application.PrintOut FileName:="", Range:=wdPrintRangeOfPages, Item:= _
       wdPrintDocumentContent, Copies:=1, Pages:="2,3", PageType:= _
       wdPrintAllPages, ManualDuplexPrint:=False, Collate:=True,
Background:= _
       True, PrintToFile:=False, PrintZoomColumn:=2, PrintZoomRow:=1, _
       PrintZoomPaperWidth:=0, PrintZoomPaperHeight:=0

End Sub
Jonathan West - 02 Feb 2007 19:36 GMT
> Hy there,
> I wrote a very simple macro to automate printing of a document and as the
[quoted text clipped - 8 lines]
> Any clue on how to execute immediately the first Application.PrintOut
> call?

set Background:=False in the printout method

Signature

Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup

Atlas - 03 Feb 2007 17:10 GMT
>> Hy there,
>> I wrote a very simple macro to automate printing of a document and as the
[quoted text clipped - 10 lines]
>
> set Background:=False in the printout method

Ok monday I'll have a go and post results
Atlas - 05 Feb 2007 11:54 GMT
>> Hy there,
>> I wrote a very simple macro to automate printing of a document and as the
[quoted text clipped - 10 lines]
>
> set Background:=False in the printout method

Yes it workd perfectly. THANKS!
 
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.