Menus and toolbars

Adding a new toolbar item for word count to the Standard Menu
Note that each predefined command has an ID. In this case, the word count command has an ID of 792.

 Dim btnNew As CommandBarButton
    CustomizationContext = NormalTemplate
    Set btnNew = CommandBars("Standard").Controls.Add _
        (Type:=msoControlButton, ID:=792, Before:=6)
    With btnNew
        .BeginGroup = True
        .FaceId = 700
        .TooltipText = "Word count"
    End With

Adding a double underline command to the formatting toolbar
The double underline command has a standard ID of 60

 CustomizationContext = NormalTemplate
    CommandBars("Formatting").Controls.Add _
        Type:=msoControlButton, ID:=60, Before:=7






Comments

Popular posts from this blog

Find and replace

Formatting

Page setup