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?

Était-ce utile?

La 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

Autres conseils

It represents the null value.

From MSDN

Represents the sole instance of the Missing class.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top