WinWord.exe won't quit after calling Word.Documents.Add - Word .NET Interop

后端 未结 13 1829
没有蜡笔的小新
没有蜡笔的小新 2020-11-30 06:27

I\'m running into the classic scenario where, when creating Word COM objects in .NET (via the Microsoft.Office.Interop.Word assembly), the WinWord process won\'t exit even t

13条回答
  •  无人及你
    2020-11-30 07:22

    I got the same problema when i was doing it:

    object missing = System.Reflection.Missing.Value;
    wordApplication.Quit(ref missing, ref missing, ref missing);
    

    I solved this way:

    object objFalse = false;
    wordApplication.Quit(ref objFalse, ref objFalse, ref objFalse);
    

    Don't ask me why, automating office is an adventure :)

提交回复
热议问题