Correct Printer Name for Word 2003

R

Ron Dadras

Hi,
My C# program generates two Word 2003 documents and needs to print the
documents to different printers. The program presents Windows printer dialog
box to get the name of desired printer but when it passes this printer name
to Word, the Word will not be able to print. I found out Word will print
using default printer but does not like the names I get from printer dialog
box. Further investigation revealed Word affixes extra location details to
the end of the printer name.

For example:
Printer name shown in printer dialog box: \\ymp2\hp psc 2400 series
Printer name expected by word: \\ymp2\hp psc 2400 series on Ne05

Printer name shown in printer dialog box: Adobe pdf
printer name expected by word: Adobe pdf on Ne03

How do I get the correct printer names as what the word expects?

Thanks,
RD
 
S

scw-tzg

Sorry this isn't an answer, but I am investigating the same issue (automating
from c++ instead). For what it's worth, I was doing this sucessfully in the
past when I was automating from VB6. Then I was using the VB Printers
collection/object to get this information:

For Each lcPrinter In Printers
If (pszPrinterStr$ = lcPrinter.DeviceName & "," &
lcPrinter.DriverName) _
Or (pszPrinterStr$ = lcPrinter.DeviceName) _
Or (pszPrinterStr$ = lcPrinter.DeviceName & " on " & lcPrinter.Port)
Then '* _
....

I've tried using the EnumPrinters Windows API to get the various
PRINTER_INFO structures, but none of them contain a Port name like 'Ne0#',
although PRINTER_INFO_2 has a pPortName like IP_123.456.789.012.
 

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