Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Nov 2002
    Thanked 0 Times in 0 Posts

    Ediitng an existing custom toolbar (2003 - 2007)

    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.
    Attached Files Attached Files

  2. #2
    Plutonium Lounger
    Join Date
    Nov 2001
    Thanked 7 Times in 7 Posts

    Re: Ediitng an existing custom toolbar (2003 - 2007)

    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.

    <code>Debug.Print CommandBars("LSI").Controls(1).Builtin
    (so we know this is a builtin control)

    <code>Debug.Print CommandBars("LSI").Controls(1).ID
    (this is the ID for the builtin control that applies a style)

    <code>Debug.Print CommandBars("LSI").Controls(1).Parameter
    Body Text</code>
    (So the first control on your toolbar applies the Body Text style)

    You can examine the other buttons using similar commands.


  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 31 Times in 31 Posts

    Re: Ediitng an existing custom toolbar (2003 - 2007)

    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>post 203,498</post#> 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"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts