Printing from VBA with Word (1 Viewer)

Spooky

Registered User.
Local time
Today, 02:17
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 (which could be any number of printers)

Im using this basic code to do so (with limited success)

Code:
            ActiveDocument.PrintOut _
            Background:=True, _
            Item:=wdPrintDocumentContent, _
            Copies:=lngCopies, _
            PageType:=wdPrintAllPages, _
            PrintToFile:=False, _
            Collate:=True, _
            ManualDuplexPrint:=False
The questions are:
A) Can I select a tray?
B) Can I print double sided?
C) Can I select color?

I am trying to work out a definitive list of what VBA can modify that isnt controlled by the printer drivers.
I have googled it to death and Uncle Google seems to suggest no to all of the above, so any tips to the contrary would be appreciated.
 

Cronk

Registered User.
Local time
Today, 19:17
Joined
Jul 4, 2013
Messages
2,772
It's my experience with many databases using Word automation, that there is nothing VBA that I can generate using macro recording in Word, that cannot be transported to Access VBA.

(Having claimed that, we'll see if anyone has found a black swan.)

In Access, you need to set a reference to Word (if you are not using late binding) and preface each vba line with an instantiated Word application object.

There's countless examples of such coding in this forum and elsewhere. Also code to change the default printer.
 

Spooky

Registered User.
Local time
Today, 02:17
Joined
Jun 11, 2012
Messages
18
Thanks for the link, not available under Word VBA though?
 

JHB

Have been here a while
Local time
Today, 11:17
Joined
Jun 17, 2012
Messages
7,732
Sorry - I thought the code was in MS-Access, because it is a Forum for MS-Access! :) :)
 

Spooky

Registered User.
Local time
Today, 02:17
Joined
Jun 11, 2012
Messages
18
Ahhh, sorry - clicked the wrong forum :)
 

Users who are viewing this thread

Top Bottom