0
나는 Microsoft.Office.Interop.Word 네임 스페이스에서 이벤트를 설정하는 방법은 무엇입니까?
var wordApp = new Microsoft.Office.Interop.Word.Application();
var doc = wordApp.Documents.Open(FileName);
wordApp.Visible = true;
((Microsoft.Office.Interop.Word.ApplicationEvents4_Event)wordApp.Quit) += new ApplicationEvents4_QuitEventHandler(delegate
{
MessageBox.Show("word closed!");
});
을 시도하지만 수 :
Cannot convert method group 'Quit' to non-delegate type 'Microsoft.Office.Interop.Word.ApplicationEvents4_Event'. Did you intend to invoke the method?
Microsoft.Office.Interop.Word._Application.Quit(ref object, ref object, ref object)'
and non-method 'Microsoft.Office.Interop.Word.ApplicationEvents4_Event.Quit'. Using method group.
내가 때문에 경고의 캐스트를했지만 해결되지 않았다. 이 오류를 해결하는 방법을 모르겠습니다. 미리 감사드립니다.
감사합니다! 너는 나의 날을 구했다. 당신도 좋은 하루 보내세요. – Jack