[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

相关文章
相关标签/搜索