"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...