Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Utah, USA
    Posts
    120
    Thanks
    0
    Thanked 0 Times in 0 Posts

    CommandButton (Word 2003)

    How do I add a new commandbutton to an existing toolbar. The commandbutton opens a userform. I have created a commandbutton on the document but can't get it into an existing toolbar.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: CommandButton (Word 2003)

    First, create a small macro that opens the userform. If you want it to be available in one document/template only, place it in a module in that document/template, but if you want it to be available in all documents, put it in a module in Normal.dot.

    Sub ShowForm
    UserForm1.Show
    End Sub

    Replace UserForm1 with the actual name of your userform.

    Switch to Word.
    Select Tools | Customize...
    Activate the Commands tab (if necessary).
    Select Macros in the list of Categories on the left.
    Select the current document/template or Normal.dot in the "Save in" box.
    Select your macro, its name will be prefixed with the project and module name.
    Drag the macro to a convenient place on a toolbar and drop it there.
    This will create a new toolbar button.
    Right-click the button to set its properties.

    BTW, was my reply to <post:=636,741>post 636,741</post:> helpful?

  3. #3
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Utah, USA
    Posts
    120
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: CommandButton (Word 2003)

    Thanks Hans,
    Yes the post was a great help. Can the code be modified to not change section numbering when pages are created. Also can you set the macro to work with section rather than pages?

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: CommandButton (Word 2003)

    Please post this question in the relevant thread, otherwise it becomes very confusing for others.

Posting Permissions

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