Patrick,
I could definitely be wrong here, but this should at least be worth a try.
It seems to work just fine for me on my systems, but I'm not running in a
domain, just a workgroup.
First, just comment out or delete the first line where you're setting the
active printer - probably just as well, as then you've changed the default
printer for the user which may surprise them later when they expect their
printouts to go to a local printer or one that's a shorter walk away than the
one you want for your process. So
Application.ActivePrinter = "\\printserver1\ParaT_HPLJ_3800 on Ne09:"
becomes (commented out)
'Application.ActivePrinter = "\\printserver1\ParaT_HPLJ_3800 on Ne09:"
In the next line of code, change the name of the ActivePrinter:= to get rid
of the " on Ne09:" portion. Try the line like this:
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"\\printserver1\ParaT_HPLJ_3800", Collate:=True
As I said, this works fine to push a printout on one of my systems with a
completely different printer set as the default printer over to a shared
printer on another system.
I think the trick is that all systems running your package will simply have
to have access to the \\printserver1\ParaT_HPLJ_3800 printer. If they are
connected to a HPLJ_3800 on another print server, it'll probably fail.
Now, there some really applicable and adaptable code showing how to find out
what printers are available on a system on this page:
http://word.mvps.org/faqs/MacrosVBA/...lePrinters.htm
In the Sub Test() routine, instead of listing the found printers via
Debug.Print you could modify the code to look for something like "HPLJ_3800"
in the printer names and save that entry to use in your .PrintOut line of
code for the ActivePrinter:= setting.
"Patrick C. Simonds" wrote:
The code below is suppose to print a worksheet, but my problem is that it is
suppose to print to a specific network printer and that printer is not
always assigned
to Ne09. I have seen it be anything from Ne01 to Ne10.
Any way this code can be forced to look for the proper Ne##?. Unfortunately,
depending on the computer from which this is run, it is not normally the
default printer.
This is just a snippet of the code. The macro is much more involved
Sub Macro7()
'
' Macro7 Macro
' Macro recorded 8/28/2008 by wta
'
'
Application.ActivePrinter = "\\printserver1\ParaT_HPLJ_3800 on Ne09:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"\\printserver1\ParaT_HPLJ_3800 on Ne09:", Collate:=True
End Sub