Possible duplicate:
How to eliminate the ambiguity warning?
I work with MS Office Word in my application using the following code:
var wordApplication = new Microsoft.Office.Interop.Word.Application(); var wordDoc = wordApplication.Documents.Open(ref fileName);
call:
wordDoc.Close(); wordApplication.Quit();
to give:
The ambiguity between the Microsoft.Office.Interop.Word._Application.Quit (ref object, ref object, ref object) 'method and the non-method' Microsoft.Office.Interop.Word.ApplicationEvents4_Event.Quit. Using the group of methods.
I tried to set the query arguments:
object nullObject = Type.Missing; wordDoc.Close(ref nullObject, ref nullObject, ref nullObject); wordApplication.Quit(ref nullObject, ref nullObject, ref nullObject);
but he gives the same error. How to fix it? Thanks in advance!
source share