Word.ApplicationClass ProcessID

M

Marco Mendonça

Hi,

I'm launching Word within a .net c# application. At some point, i
instantiate Word.ApplicationClass class and notice that this starts a new
Word Process (you can view this by looking at TaskManager). Now, i need to
register these Process IDs.
Question: How can i access the ProcessID that corresponds to the
Word.ApplicationClass?

Best Regards,
Marco Mendonça.
 
B

Beth Melton

I'm not exactly sure of what you are after. I *think* you are trying
to end the process when your tasks are complete?? In that case you
just need to exit the application and set object variable for the Word
instance to nothing. I'm not familiar enough with C# to tell you how
to do this, however you may want to post this question in one of the
Word or Office developer newsgroups since that's where the automation
experts tend to hang out. :)

Please post all follow-up questions to the newsgroup. Requests for
assistance by email can not be acknowledged.

~~~~~~~~~~~~~~~
Beth Melton
Microsoft Office MVP

Word FAQ: http://mvps.org/word
TechTrax eZine: http://mousetrax.com/techtrax/
MVP FAQ site: http://mvps.org/
 
M

Marco Mendonça

I'm really after what i've said: to know exactly the ProcessId that
corresponds to the Word.ApplicationClass Word Instance.

I have an application with an embedded Word Object. Nothing stops the user
from ending the Process of the application in the TaskManager. Doing so will
leave Word Processes living forever. So, i'm registering every Word process
launched inside the application and, when the application starts, i just kill
those registered processes (actually, i'm registering the processId and its
startTime).

For now, i've managed to "catch" the Word process by comparing its startTime
to the time instant obtained before and after the call to the constructor of
Word.ApplicationClass. This is working, but it's not a "clean" solution...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top