Cannot assign printer in code.

T

ThomasAJ

Because a printer attached to Server 2003 will not function I need to direct
Word Automation to print to another printer - but cannot.

This is complicated please bear with me.

I use the following code:
"oWordApp.WordBasic.FilePrintSetup Printer:=strHP1160,
DoNotSetAsSysDefault:=1" which works well for any printer on any PC on the
local LAN.
'strHP1160' contains the string pointing to a printer eg "\\Server1\Printer1".

OK so I CANNOT use 'Printer1' and I need to use a printer that has been
'brought' to Server1 by a Terminal Services session. The 'brought' printer
can be printed to from any app on Server1 eg Notepad no problem at all.

However when I initialize the variable 'strHP1160' with the 'brought'
printer I get a message (when the above code is executed) that simply says
'There is a printer error'. The string I initialize with is rather long: "HP
LaserJet 3050 Series PCL 6 on IBM-R40-LAPTOP (from FAYE_AT_NOOSA) in session
2". Maybe that's the problem.

I have shared the printer and given all permissions to all.
 

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