Example

The following examples create a sample toolbar button 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", 12, False, "", rcBmpWRQ, "", _

     rcBmpWRQ, "Sample", "About Reflection", _

     "Display the About Reflection Dialog box", _

     "AboutReflectionDlg "

  End With

End Sub

Here is the equivalent procedure using named arguments:

Sub SampleButtonNamedArguments()

 With Session

  .DefineToolbarButton _

     ToolbarName:="Standard", _

     Index:=12, _

     Separator:=False, _

     SmallPictureFile:="", _

     SmallPicIndex:=rcBmpWRQ, _

     LargePictureFile:="", _

     LargePicIndex:=rcBmpWRQ, _

     Label:="Sample", _

     Tip:="About Reflection", _

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

     Commands:="AboutReflectionDlg "

 End With

End Sub