Question

I encountered a code given below

Object oMissing = System.Reflection.Missing.Value
oDataDoc = wrdApp.Documents.Open(ref oName, ref oMissing,
                    ref oMissing, ref oMissing, ref oMissing, ref oMissing,
                    ref oMissing, ref oMissing, ref oMissing, ref oMissing,
                    ref oMissing, ref oMissing, ref oMissing, ref oMissing,
                    ref oMissing);

I dont understand what will ref oMissing do. Will it automatically get the values or something like that?

Was it helpful?

Solution

It represents null value. Note that null is not equal to Missing.Value

Just to add more information, as you can see in the screen shot below, Missing.Value is NOT equal to null, and in fact is a new instance of Missing class object

enter image description here

OTHER TIPS

It represents the null value.

From MSDN

Represents the sole instance of the Missing class.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top