I create an instance of word as follows
Expand|Select|Wrap|Line Numbers
- Word.ApplicationClass wd = new Word.ApplicationClass();
- wd.Caption = "My Word";
- int wordHandle = FindWindow("Opusapp", wd.Caption);
1)
Word.ApplicationClass wd = new Word.ApplicationClass();
creates the winword.exe process,right?then...how can I get the Process Id of that word instance I have just created?thus I can kill it at a later stage by
Expand|Select|Wrap|Line Numbers
- Process[] wordProcesses = Process.GetProcessesByName("WINWORD");
- foreach (Process p in wordProcesses)
- {
- if (p.Id = myProcessId)
- p.Kill;
- }
If anyone can bring some light to these issues...
Many thanks