By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,693 Members | 1,936 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,693 IT Pros & Developers. It's quick & easy.

Getting process id of Office-applications

P: n/a
Hi all,
I'm working with a win app in vb that needs access to actual process id of
the office-applications Word, Excel and PowerPoint. I know I can loop the
processes and check for processes of these applications by name etc., but it
will not be good enough, I need to use the exact process id.

I also know that I can get it for Excel by doing as described here:
http://groups.google.com/group/micro...a40849a87c7b02
using hWnd.

Now, I can't find this exposed by Word or PowerPoint. Is it just me not
finding it, or isn't this possible to do with Word and PowerPoint??

Any help is greatly appreciated.
/Henrik

Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"Henrik" <no*****@nomailx.no> schrieb:
I'm working with a win app in vb that needs access to actual process id of
the office-applications Word, Excel and PowerPoint. I know I can loop the
processes and check for processes of these applications by name etc., but
it
will not be good enough, I need to use the exact process id.


What information about the running instances of the Office applications do
you have? If you don't have any information, using the 'Process' class
isn't that bad.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #2

P: n/a


"Herfried K. Wagner [MVP]" skrev:
"Henrik" <no*****@nomailx.no> schrieb:
I'm working with a win app in vb that needs access to actual process id of
the office-applications Word, Excel and PowerPoint. I know I can loop the
processes and check for processes of these applications by name etc., but
it
will not be good enough, I need to use the exact process id.


What information about the running instances of the Office applications do
you have? If you don't have any information, using the 'Process' class
isn't that bad.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>


Well, the only information that I have is the info that I can get from the
instantiated objects for each of word, excel and powerpoint. Such as hWnd
from the excel application object. With that I can get the exact process id
for the excel app for that instantiated object. Now, I don't know how I will
be able to map any running word process that belongs to the app I've created
in my code (such as Dim X As New Word.Application) just using the processes
itself. I know I can get which processes that are word etc., but how will I
know that I can kill the process that is the one I created from the code. I
could perhaps use window titles to try to find out which file is open in
which word process, but since this will be used if there are problems with
the applications (like they've hanged etc.), it isn't always loaded correct.

Thanks again for any help...
Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.