Example The Example Macro Macro

Sub ExampleMacro()

MsgBox "Custom button pressed" End Sub

Next, we add a built-in File Open... custom control, whose Id happens to be 23. (We have already discussed how to get built-in control IDs.) This custom control automatically displays the Open dialog box. Note that we set the FaceId to 23 as well. This displays the default icon for the Open command, but we could choose another icon if desired.

Then we add the built-in Spelling custom control, which checks the spelling of the active document.

Finally, we add a custom list box and populate it with the names of three composers. Note that we set the Tag property of this list box. The reason is that we want to be able to use the FindControl method to find the list box from within the macro that is assigned to the OnAction property, which is shown in Example 12-8.

0 0

Post a comment