How to Kill the particualr instance of the WINWORD in C#
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
VulpesRank #55 · 29.2K reputationPosted Sep 20, 2011, 1:19 AM EDT
http://www.c-sharpcorner.com/Forums/Thread/118444/how-to-avoid-opening-the-worddocument-which-is-already-open.aspx
Dorababu MekaRank #457 · 5.5K reputationPosted Sep 20, 2011, 1:25 AM EDT
ByVal hWnd As IntPtr, _
ByRef lpdwProcessId As IntPtr) As IntPtr
' create the excel instance...
Dim exl As Excel.Application = New Excel.Application
' let's get it's process!
Dim processId As IntPtr
' we ignore the return value, since we don't care
' about the thread id...
GetWindowThreadProcessId (exl.hWnd, processId)
Dim excelProcess As Process = Process.GetProcessById (processId.ToInt32())
Sam HobbsRank #107 · 20.5K reputationPosted Sep 20, 2011, 2:40 PM EDT