P
Peter
Hello,
Thanks for reviewing my question. I have written a sample C# add-in for
Word and I am curious why (when calling a Word's own API) that I have to pass
optional parameters as a reference. (I cannot say this is the case for all
of them but it seems common.) I would think they would be by value so you
can pass them as null.
Word.ApplicationClass appWord = new Word.ApplicationClass();
object objTemplate = "";
object objNewTemplate = false;
object objDocType = Word.WdNewDocumentType.wdNewBlankDocument;
object objVisible = true;
appWord.Documents.Add(ref objTemplate,ref objNewTemplate,ref objDocType,ref
objVisible);
Thanks
Peter
Thanks for reviewing my question. I have written a sample C# add-in for
Word and I am curious why (when calling a Word's own API) that I have to pass
optional parameters as a reference. (I cannot say this is the case for all
of them but it seems common.) I would think they would be by value so you
can pass them as null.
Word.ApplicationClass appWord = new Word.ApplicationClass();
object objTemplate = "";
object objNewTemplate = false;
object objDocType = Word.WdNewDocumentType.wdNewBlankDocument;
object objVisible = true;
appWord.Documents.Add(ref objTemplate,ref objNewTemplate,ref objDocType,ref
objVisible);
Thanks
Peter