Changing default printer using VBA

  • Follow


I want to put a statement in my code that changes the default printer to 
what I need it to be.  Please, what is that statement?

Richard Mogy 


0
Reply Rich 9/19/2007 4:55:36 PM

In Access 2002 or later, this is trivially easy.

Just set the Printer object, e.g.:
    Set Printer = Printers(0)
or
    Set Printer = Printers("Microsoft XPS Document Writer")

To reset to the default Windows printer:
    Set Printer = Nothing

For earlier versions it is more involved. See:
    http://www.members.shaw.ca/AlbertKallal/msaccess/printch2k.zip
or:
    http://www.members.shaw.ca/AlbertKallal/msaccess/printch97.zip
for Access 2000 or 97 respectively.

-- 
Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Rich Mogy" <rmogy@sbcglobal.net> wrote in message
news:cwcIi.27877$eY.682@newssvr13.news.prodigy.net...
>I want to put a statement in my code that changes the default printer to 
> what I need it to be.  Please, what is that statement?
> 
> Richard Mogy
-1
Reply Allen 9/19/2007 5:10:24 PM

1 Replies
1611 Views

(page loaded in 0.069 seconds)


Reply: