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 automation MS-Word printing problem 1

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???????????


Is there something else I must do so that printers are recognized when using COM automation? I tried setting the ActivePrinter property, but this did nothing.
 
Sorry, it seems like I didn't make it clear that everything is local to my desktop. The Oracle9 database is running on my Win2k desktop and the PL/SQL procedures create an MS-Word document in a folder on my C: drive, so there's no server involved. Since the FileOpenNew, Insert and FileSave methods all operate on a local level, I'm assuming the FilePrint method does too. Meaning it will try to print from my desktop.
 
I still think this is security issue. Oracle service normally runs as Local System account that is not allowed to print. Try to add this account to printer security list or choose another account. Don't forget that both listener and service must use the same account.

Regards, Dima
 
You were absolutely correct. Problem solved.

This is in fact how I have the production databases setup for very similar reasons, but silly me forgot about this when creating the database on my computer.

Thanks for your help!!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top