c# MSOffice Interop Word will not kill winword.exe

前端 未结 5 1571
野趣味
野趣味 2021-01-04 11:04

I\'m writing an application that needed a MSWord document parser.

I\'m using Microsoft.Office.Interop.Word.Document to extract the texts from the documents, but even

5条回答
  •  悲&欢浪女
    2021-01-04 11:45

    Are you calling Application.Quit , additionally since you're doing Interop it may be worthwhile to release the RCW wrapper.

    So basically something like:

    yourWordAppObject.Quit();
    System.Runtime.InteropServices.Marshal.FinalReleaseComObject(yourWordAppObject);
    

    Note some folks use: ReleaseComObject but there are some potential pitfalls

提交回复
热议问题