Is it possible to change printer settings e.g. colour/double-sided in VBA code when automating word documents

mageeg

Board Regular
Joined
Jun 6, 2021
Messages
81
I have written code which at a click of a button, prints off a word document.

I have many different documents to print, all of which have their own button.

The problem is, different documents require different printer settings. e.g. some need colour, some do not.

So it is not possible to set the printer properties, then have them all print out in the same way. Is it possible to set these settings within the code itself?

My code is simple as follows:
VBA Code:
Dim wd As Object
Dim wdDOC As Object 'word document

Set wd = CreateObject("Word.Application")

Set wdDOC = wd.Documents.Add("T:\mageeg\RM Manual Rev2.docx")

wd.Visible = False

wdDOC.PrintOut

Set wd = Nothing 'Release memory allocated to WD

MsgBox ("RM Manual Printed")

wdDOC.Close

Set wdDOC = Nothing


End Sub
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
The answer here and the link to the MSDN page should be informative.
Hopefully, the printer settings are determined by the document settings to get this to work.
 
Upvote 0

Forum statistics

Threads
1,214,940
Messages
6,122,361
Members
449,080
Latest member
Armadillos

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top