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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

If multiple Word sessions running, how do I attach to correct instance

Status
Not open for further replies.

SBendBuckeye

Programmer
May 22, 2002
2,166
US
Client has system which allows indirect object calls via hidden ActiveX controls on the form. They want to embed a Word document in a report and call it one time for each row of the report that is generated.

I can launch Word hidden and then create a .doc file for the report to pick up. The problem is their system can't store an object reference so I am using CreateObject each time to instantiate Word.

To avoid the overhead of constantly opening and closing Word, I would like to leave Word hidden and then use GetObject to reattach to it. But how can I ensure that I have the one I want and not a session that maybe the user started while the report runs for a long time.

Are there any API calls that would help with this, or is this something simple to do? Please forgive me if this is a really obvious question. Thanks for any help and/or suggestions you can give me!

Have a great day!

j2consulting@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top