The Microsoft.Office.Interop.Word._Document interface has a method with the following signature:
void Close(ref object SaveChanges = Type.Missing, ref object OriginalFormat = Type.Missing, ref object RouteDocument = Type.Missing);
A few points I am having trouble understanding:
- A ref parameter cannot have a default value.
- A default value has to be a constant, and
Type.Missingis not. - When calling this method, I can use
Close(false)- normally a ref parameter requires an assignable variable? - When navigating to the definition of
Typein Visual Studio, it takes me to the _Document.Type property, but this does not have a property namedMissing. Is this a bug in VS?
Thank you for any explanations.
System.Type.MissingAll in all, use VB.NET if you're going to use COM libraries like this - it will save you an incredible amount of trouble. VB was the COM language, after all.refalready, sorry :))