The following examples adds a sample toolbar button to the Standard toolbar that opens the About Reflection dialog box. Because of the number of arguments this method takes, you might prefer to use named arguments. The second example is equivalent to the first, but uses named arguments. In both examples, the underscore line continuation character is used to break up the long line.

Sub SampleButton()

With Session

.DefineToolbarButton "Standard", 16, True, "", 0, "", _

0, "Sample", "About Reflection", _

"Display the About Reflection Dialog box", _

rcBuiltInFunction, "HelpAboutReflection"

End With

End Sub

Here is the equivalent procedure using named arguments:

Sub SampleButtonNamedArguments()

With Session

.DefineToolbarButton _

ToolbarName:="Standard", _

Index:=16, _

Separator:=True, _

SmallPictureName:="", _

SmallPicIndex:=0, _

LargePictureName:="", _

LargePicIndex:=0, _

Label:="Sample", _

Tip:="About Reflection", _

Help:="Display the About Reflection Dialog box", _

CommandType:=rcBuiltInFunction, _


End With

End Sub