BrianLong
10-26-2007, 11:48 AM
I am looking to add some automatic printing at the end of an inport macro that I wrote. Using the search function of these forums I found what I thought was the exact answer to my problem, but I cannot figure out what I am doing wrong. I am trying to adapt the tips found in
vbaexpress.com/kb/getarticle.php?kb_id=528
The code that I have written (stripped down to the print portions) is as follows.
Dim PrintUp as String 'Holds location of network printer upstairs
Dim PrintPDF as String 'Name of PDF printer
PrintUp = "\\ fpserver-dc\ome-cm4520" '(a space added after "\\" to avoid auto linking that is keeping me from making post)
PrintPDF = "Adobe PDF"
Application.ActivePrinter = PrintUp
sheets(2).printout
I will eventually add in code that will print to the correct place depending on what conditions are met... but as it stands it always prints to my default printer... i am starting to waste more paper that I'd like.
Secondly I am not exactly sure what to put down for my PDF printer, that is the title of it in my printers window.
If it makes a difference I am using Vista and the display name of my upstairs printer is "OME-CM4520 on FPSERVER-DC"
vbaexpress.com/kb/getarticle.php?kb_id=528
The code that I have written (stripped down to the print portions) is as follows.
Dim PrintUp as String 'Holds location of network printer upstairs
Dim PrintPDF as String 'Name of PDF printer
PrintUp = "\\ fpserver-dc\ome-cm4520" '(a space added after "\\" to avoid auto linking that is keeping me from making post)
PrintPDF = "Adobe PDF"
Application.ActivePrinter = PrintUp
sheets(2).printout
I will eventually add in code that will print to the correct place depending on what conditions are met... but as it stands it always prints to my default printer... i am starting to waste more paper that I'd like.
Secondly I am not exactly sure what to put down for my PDF printer, that is the title of it in my printers window.
If it makes a difference I am using Vista and the display name of my upstairs printer is "OME-CM4520 on FPSERVER-DC"