Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Word, printing, and VFP
Message
 
To
21/03/2000 09:53:53
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00348349
Message ID:
00348365
Views:
28
>Hey all.
>
>I have a situation which is really strange. I have instanced Word in a method with CREATEOBJECT() and then proceed to build a fairly complex 3 page document. At the end of the document assembly, I do an oWord.PrintOut() to print the sucker. Finally, oWord.Quit(0) and oWord=.NULL.. I never Activate or oWord.Visible=.T.
>
>For security reasons, I cannot actually show Word to the user. The client does not want the documents modified or saved or manually manipulated in any way.
>
>The problem is this: The document does not get handed off to the print queue unless I make word visible. The Quit method appears to be following too close to the PrintOut method is my guess.
>
>I can resolve this problem by creating oWord at the application and not Quitting it until the application is quit, but that seems suboptimal in terms of resources.
>
>Any way to A) Guarantee that the document is printed regardless? and B) Do it in a way that I can release Word without inserting some sort of wait state or use Visible? and C) Be able to tell that Word has finished sending the document to the Windows print queue?

John,

Have you looked at the background par that you can use with printout.

oxx=createobject("word.application")
oxx.visible=.f.
oxx.Documents.Add
oxx.ActiveDocument.PrintOut(.f.)
oxx.quit
release oxx

Works for me. The default is true and from the way I read the help file true allows macro to continue to run whilw false should wait until complete.

HTH
Jeff

It's Time to get a gun.

That's what I've been thinkin.

I think I can afford one, If I do a little less Drinkin.

www.TrueGeeks.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform