Printing from VBA with Word (1 Viewer)

Spooky

Registered User.
Local time
Today, 07:57
Joined
Jun 11, 2012
Messages
18
I have a Word VBA project that outputs multiple word documents and I wish to print (x) number of docs to the default printer of which I have no control

Im using this basic code to do so:

Code:
            ActiveDocument.PrintOut _
            Background:=True, _
            Item:=wdPrintDocumentContent, _
            Copies:=lngCopies, _
            PageType:=wdPrintAllPages, _
            PrintToFile:=False, _
            Collate:=True, _
            ManualDuplexPrint:=False

I am trying to work out a definitive list of what VBA can modify that isnt controlled by the printer drivers. At the moment it seems it is only the number of copies and manual duplex so any tips to the contrary would be appreciated.

The questions are:
A) Can I select a tray?
B) Can I print double sided?
C) Can I select color?

I have googled it to death and Uncle Google seems to suggest no to all of the above
 

gerry@docshop.ie

Registered User.
Local time
Today, 14:57
Joined
Jun 19, 2013
Messages
41
Control of the pages on the printer is through the page setup

Selection.PageSetup.FirstPageTray = wdPrinterPaperCassette
Selection.PageSetup.OtherPagesTray = wdPrinterPaperCassette

I used the record macro to get the code to setup a page and the specific printer settings for the default printer. Then modified the recorded macro for my needs. Note that ifferent printers have different paper tray Id's and the ones above are from a Kyocera Laser. I was quite successful in getting document to print from several different trays on my printer. The change print settings on the document you need to have separate document sections. Hope this helps
 

Spooky

Registered User.
Local time
Today, 07:57
Joined
Jun 11, 2012
Messages
18
Thanks, Ill try recording a macro like suggested to see if it gives some more hints.
The unfortunate problem is the project may be used in any one of many remote locations where I have no input into the user or office setup - hence the hope for generic settings
 

Users who are viewing this thread

Top Bottom