Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

COM/MS-WORD automation printing problem

Status
Not open for further replies.

Oracle9Guy

Programmer
Feb 20, 2004
9
US
I've written a number of PL/SQL procedures that successfully use the ORDCOM package to create a Word.Basic object, open a new MS-Word document, insert text into the document and then save it. Where I'm having a problem is when I go to print the document. It seems like I should just be able to call the "FilePrint" method while the document is open to get it to print on my default printer, however, I get the error message "Word cannot print. There is no printer installed." I also tried setting the "ActivePrinter" propoerty in the Word object, but this didn't make any difference.

I'm using Oracle 9.2 on my Windows 2000 desktop. I do have a printer installed and I can print docs without a problem when running MS-Word interactively. The problem seems to be that the Word object instantiated via COM automation either can't see the printer settings already defined in Windows or needs its own definitions. I've done several several searches and can't find any references to this problem.

Anyone have any ideas???????????
 
This may sound absurd:

I think it tries to print from the Oracle Server and not on your local machine... If you think in this angle, that may lead you right?

Cheers,

Ravi
 
No, it is trying to print locally.

Actually, I figured out the problem. I forgot that by default, the Oracle services are run by user "LocalSystem" which of course doesn't have any printers installed. As soon as I restarted the Oracle services with my user ID the FilePrint method starting acting as expected (i.e, printing the currently open document on my default printer).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top