• Ediitng an existing custom toolbar (2003 – 2007)

    Home » Forums » AskWoody support » Productivity software by function » MS Word and word processing help » Ediitng an existing custom toolbar (2003 – 2007)

    Author
    Topic
    #456493

    Attached is a zip file with a word addin that creates a custom toolbar named LSI. The toolbar is not pretty and it performs standard word functions like indenting, bullets, etc. why someone did this I am not sure. I wanted to see what all standard word functions they are using but I do not know how to look at an existing custom toolbar, i.e. editing it. What steps are required. I trying to do this in Word 2003 and have tried 2007 as well but can’t figure it out. I have found articles about how to create a custom toolbar which I know how to do but nothing about modifying an existing one especially like renaming the commands or changing what functions are accessed by a item, and so on.

    Viewing 1 reply thread
    Author
    Replies
    • #1140893

      You can look at the properties of these buttons by going to the Visual Basic Immediate Window (Alt-F11 followed by Control-G) and typing commands like.

      Debug.Print CommandBars("LSI").Controls(1).Builtin
      TRUE

      (so we know this is a builtin control)

      Debug.Print CommandBars("LSI").Controls(1).ID
      2321

      (this is the ID for the builtin control that applies a style)

      Debug.Print CommandBars("LSI").Controls(1).Parameter
      Body Text

      (So the first control on your toolbar applies the Body Text style)

      You can examine the other buttons using similar commands.

      StuartR

    • #1140896

      Some of the buttons on the toolbar execute built-in functions. Such buttons have an ID > 1; the ID represents the function executed by the button. See post 203,498 for a way to find out these IDs. Example: BT. You can’t assign another action to these buttons for ID is read-on;y. You’d have to delete the button and create a new one.

      Others insert an AutoText entry that is stored in the template. Example: 2ColTable.

      Yet others apply a style to the selected text. Example: TT.

      As StuartR pointed out, the name of the AutoText entry or Style is the Parameter property of the button. You can change this:

      CommandBars(“LSI”).Controls(“TT”).Parameter = “Heading 1”

      A fourth type of button executes a macro. The name of the macro is stored in the OnAction property, and you can assign another macro by changing the value of OnAction. Example: BuildPM.
      To assign the (fictitious) macro MyMacro to this button, you’d use

      CommandBars(“LSI”).Controls(“BuildPM”).OnAction = “MyMacro”

      The name of a button is its Caption property. You can change this:

      CommandBars(“LSI”).Controls(“BuildPM”).Caption = “Some Other Text”

    Viewing 1 reply thread
    Reply To: Ediitng an existing custom toolbar (2003 – 2007)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: