Try casting your docs
first:
((_Document)docs).Close(ref nullobject, ref nullobject, ref nullobject);
The Microsoft.Office.Interop.Word.Document interface implements both the DocumentEvents2_Event and _Document interfaces. Each have a close method, and the compiler is having trouble determining which you mean.
Alternatively, you could declare your docs
variable as a _Document
in the first place:
Microsoft.Office.Interop.Word._Document docs = wordObject.Documents.Open ...
The same resolution can be used for ambiguities on your wordObject
, casting it to an _Application
.