Change Windows XP default printer from Access

B

banem2

Here is a tricky: I am sending data from Access to Word template,
print and close Word template. What I need is to change default system
printer, print from Word and return original default system printer.
User prints cheques on specific printer and want to maintain document
in Word template so they can easily make changes.

Albert Kallal solution does not work on Windows XP - Word prints on
the same printer, but when code finish execution there is no any
default printer set in system.

Macro in Word won't work either as they want to pick printer before
printing, so I have build form which lists all available printers in
network, but I am missing code to set printer as default.

Any suggestions are appreciated.
 
B

banem2

Here is a tricky: I am sending data from Access to Word template,
print and close Word template. What I need is to change default system
printer, print from Word and return original default system printer.
User prints cheques on specific printer and want to maintain document
in Word template so they can easily make changes.

Albert Kallal solution does not work on Windows XP - Word prints on
the same printer, but when code finish execution there is no any
default printer set in system.

Macro in Word won't work either as they want to pick printer before
printing, so I have build form which lists all available printers in
network, but I am missing code to set printer as default.

Any suggestions are appreciated.


Solution is to change printer in Word temporary with:

objWord.Application.ActivePrinter = strPrinter
objWord.Application.ActiveDocument.ActivePrinter = strPrinter
objWord.ActivePrinter = strPrinter
 

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