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?

有帮助吗?

解决方案

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

其他提示

It represents the null value.

From MSDN

Represents the sole instance of the Missing class.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top