How can I change bw to color in my printer via VBS?

H

hannu

Hi.

I have a code which changes the defaul printer to another and then
back.

But I would like to print in color to that another printer and because
it have to be bw by default so I have to change the parameter via VBS.

My printing document is MS Word 2003 and my OS is Win XP.

Where do I put the command so that printer understands to print in
color?


Code is:
Dim DP as string
Function GetDefaultPrinter()
Set oShell = CreateObject("WScript.Shell")
sRegVal = _
"HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows
\Device"
sDefault = ""
On Error Resume Next
sDefault = oShell.RegRead(sRegVal)
sDefault = Left(sDefault ,InStr(sDefault, ",") - 1)
On Error Goto 0
GetDefaultPrinter = sDefault
End Function
DP=GetDefaultPrinter
msgbox ("Your default printer is " & GetDefaultPrinter)

Set object = CreateObject("Wscript.Network")
strprintername="\\Servername\Xerox WorkCentre 7345"
object.SetDefaultPrinter(strPrinterName)
msgbox ("Your default printer is now " & strprintername)

Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "c:\Document.doc"

Set object = CreateObject("Wscript.Network")
object.SetDefaultPrinter(DP)
msgbox ("Your default printer has set back to " & entinenoletus)


Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top