Sometimes arguments to properties and methods can be omitted because they have been designated as optional. You may also wish to supply an empty or null value for a required argument. JScript and VBScript have different rules for doing this.
InsertImage(strSrc, [strAlt], [strAlign], [strWidth], [strHeight], [strBorder])
If you want to supply a value for strWidth and strHeight, you cannot omit strAlt and strAlign (though you can omit strBorder, as a trailing argument).
Selection.InsertImage("donkey.gif","","","200","150");
Sometimes the semantics of a command are such that an undesirable result will occur if you specify a null string for an optional argument. For example:
Application.NoticeBox("Hello","Yes","","","Hi");
This will result in a blank button on the dialog box. In this situation, the expression null can sometimes be used to represent the omitted value:
Application.NoticeBox("Hello","Yes",null,null,"Hi");
This technique produces the intended result in this case, but cannot be depended on to always work.
HomeKey([intLocation=0], [intSelectionType=0])
The following call is incorrect, because "" is used for the intLocation argument:
Selection.HomeKey("",1);
ans=Application.NoticeBox("Invalid paste.","Continue?",,,"Paste text")
Copyright © SoftQuad Software Inc. 1999