Optional and named arguments
f90VB cannot handle named arguments. Period. But named arguments can always be passed as positional arguments, so this is not a big limitation.
Some objects also have methods and properties that accept optional arguments. The way these arguments must be handled depends on whether they are before or after arguments that you really want to pass. You can get a good idea of how this works by studying this statement from Example 6.2:
VarTmp = ExecMethod(SelObj,'Execute',EmptyParam(),EmptyParam(), &
EmptyParam(),EmptyParam(),EmptyParam(),EmptyParam(), &
EmptyParam(),EmptyParam(),EmptyParam(),EmptyParam(), &
VariantCreate(VT_INT,2),EInfo=EInfo,iRet=iRet)
If you check the documentation for method Execute of the Find object, you will see that the method is defined as follows (from the Microsoft Word Manual):
Expression.Execute([FindText], [MatchCase], [MatchWholeWord], _
[MatchWildcards], [MatchSoundsLike], _
[MatchAllWordForms], [Forward], [Wrap], [Format], _
[ReplaceWith], [Replace], [MatchKashida], _
[MatchDiacritics], [MatchAlefHamza], [MatchControl]) _
As Boolean
Where Expression is an expression that evaluates to a Find object. All the arguments for this method are optional. In our invocation of the method in Example 6.2, we wanted to indicate that the replacement should be made in all the occurrences of the searched word. This is done by passing the value 2 on argument Replace of the Execute method. Because f90VB does not support named arguments, we call the method passing EmptyParam() for each optional argument prior to Replace. Optional arguments after Replace (i.e. at the end of the list of arguments we are actually passing) do not need to be included. f90VB is able to figure out how many optional arguments are used by a method and takes care of adding them for you, as long as it can do this at the end of your list of passed arguments.
f90VB’s function EmptyParam() returns the special variant value used by OLE Automation to indicate optional parameters that are not provided by the controller. This variant has a type of VT_ERROR with the value DISP_E_PARAMNOTFOUND as its contents.
Working with collections and object hierarchies