[VSTO] warning CS0467 解決方案

warning CS0467: Ambiguity between method 'Microsoft.Office.Interop.Word._Document.Close(ref object, ref object, ref object)' and non-method 'Microsoft.Office.Interop.Word.DocumentEvents2_Event.Close'. Using method group.ui

 

相似諸如:spa

warning CS0467: Ambiguity between 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.get

warning CS0467: Ambiguity between method 'Microsoft.Office.Interop.Excel._Workbook.Activate()' and non-method 'Microsoft.Office.Interop.Excel.WorkbookEvents_Event.Activate'. Using method group.it

 

解決辦法:io

Microsoft.Office.Interop.Word.Application 改爲 Microsoft.Office.Interop.Word._Applicationgui

 

http://stackoverflow.com/questions/8303969/how-to-eliminate-warning-about-ambiguityobject

http://stackoverflow.com/questions/8640594/compile-time-warning-when-using-microsoft-office-interop-word-document-closeim

http://stackoverflow.com/questions/10480119/warning-cs0467-when-using-microsoft-office-interop-word-document-closestackoverflow

相關文章
相關標籤/搜索