Winword process (4gl 9.1d)

gasomma

Member
Hello to All,

I use simple code for open PFD (destination=1) document passing to merge word.
Now I prefer do not show Word document and I can do that using Visible=FALSE, but Winword (task manager) process remain active. How is possible to cancel this process?
Thx
JCA

CREATE "Word.Application" chWordApplication.
chWordApplication:Visible = FALSE. /* open the template document */
chWordbook = chWordApplication:documents:OPEN("c:\ob1\offer_obs").
/* chWordApplication:Visible = TRUE. */
chMaildoc = chWordbook:Mailmerge.
chMaildoc:OpenDatasource("c:\ob1\offer.txt").
chMaildoc:Destination = 1. /* 1=PDF */
chMaildoc:EXECUTE().
chWordbook:CLOSE(NO).
 
Hi,

You have to release the object after you are done with it.

RELEASE OBJECT chWordApplication NO-ERROR.
chWordApplication = ?.
 
Hi,

I think it has to do with the fact that as far as I know outlook uses MS-Word as the default editor,
so maybe the winword process you are seeing in the task manager really belongs to the outlook session and not to the Automation Object you created in PROGRESS.
 

gasomma

Member
Hello,

I'm using MS office 2007 and when outlook is open, outlook.exe process is active (no winword.exe process appears).
Thx
JCA
 

adisney

New Member
Try adding in chWordApplication:Quit() no-error before you release the handle. Also, I would leave the whole thing as visible and see what happens when you run your code. Word may have some little dialogue box up which is preventing the close.

Good luck!
Anne
 

gasomma

Member
Good. Now work properly. Adding "QUIT()" the process has been cancelled (keeping or not keeping word visible).
Thx.
JCA
 
Top