Syntax
ChooseButtonImage [.Face = number,] .Button = number, [.Context = number,] [.Text = text,] .Toolbar = text
Remarks
Changes the image or text on the specified toolbar button.
Argument | Explanation |
.Face | A number corresponding to an image for the button in the built-in set of button images, where 0 (zero) is no image (for a blank button), |
.Button | A number corresponding to the position of the button to change on the specified toolbar, where 1 is the first position, 2 is the second, and so on. Note that a list box or space counts as one position. If you specify a position that corresponds to a space, Word modifies the button to the right of the space. |
.Context | Determines where the toolbar change is stored: 0 (zero) or omitted Normal template 1 Active template |
.Text | The text you want to appear on the button. If you specify both .Face and .Text, .Text takes precedence. |
.Toolbar | The name of the toolbar as listed in the Toolbars dialog box (View menu). |
Note
You can choose a button image for a list box on a toolbar; however, the button is displayed only when the toolbar is vertical.
Examples
This example changes the image on the Stop button on the Macro toolbar to button image 50:
ChooseButtonImage .Face = 50, .Button = 9, .Context = 0, \ .Toolbar = "Macro"
The following example creates a dialog record for the Custom Button dialog box (Toolbar Customization shortcut menu) and then displays the dialog box so you can modify the third button on the Standard toolbar. Note that, unlike those for other dialog records, instructions that set values in a ChooseButtonImage dialog record must precede the GetCurValues instruction.
Dim dlg As ChooseButtonImage dlg.Toolbar = "Standard" dlg.Button = 3 GetCurValues dlg Dialog dlg ChooseButtonImage dlg
See Also
AddButton, CopyButtonImage, EditButtonImage, MoveButton, PasteButtonImage, ResetButtonImage