Results 1 to 7 of 7
  1. #1
    Star Lounger
    Join Date
    Jul 2002
    Location
    melbourne, Victoria, Australia
    Posts
    61
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Create a Command Button (Word 2002)

    I have created a macro, which worked well. I now want to create a command button and assign that macro to the command button. I don't know much about code, can anyone advise me how I can go about this.

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

    Re: Create a Command Button (Word 2002)

    1. Right click any toolbar, and click Control Toolbox.
    2. Click in your document where you want the command button to be placed.
    3. Click the Command Button button on the Control Toolbox.
    4. Double click the command button in your document.
    5. You will be taken to the Visual Basic Editor; a click event handler for your button has already been created for you.
    6. In the blank line between Private Sub ... and End Sub, type the name of your macro.
    7. Switch back to Word. You are presently in design mode.
    8. Click the Design Mode button on the Control Toolbox (ruler, triangle, pencil) to turn it off.
    9. Now, before testing the command button, save your document.
    10. Test...

  3. #3
    Star Lounger
    Join Date
    Jul 2002
    Location
    melbourne, Victoria, Australia
    Posts
    61
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Create a Command Button (Word 2002)

    Thank you very much for your prompt reply, you instructions were great and it all went well. Great!!!

  4. #4
    Star Lounger
    Join Date
    Jul 2002
    Location
    melbourne, Victoria, Australia
    Posts
    61
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Create a Command Button (Word 2002)

    Do you know if I can give the command button a more descriptive name? How can I do this?

  5. #5
    Star Lounger
    Join Date
    Jul 2002
    Location
    melbourne, Victoria, Australia
    Posts
    61
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Create a Command Button (Word 2002)

    THANK YOU for your tips, I have learnt alot. But this is still not quite working properly. I have been able to create a command button and assign the marco to this button and also change attributes, thanks for that. I followed your instructions and made sure that the design mode is turned off, but when I open this document the design mode is turned on. Then I have turned the design mode off and clicked again on the command button and it then does not work. I want to be able to save this document as a template. Can yo tell me what is wrong with this?

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

    Re: Create a Command Button (Word 2002)

    If you have macro security set to high (Tools/Macro/Security), your document will open in design mode automatically.
    I recommend setting it to Medium. Then, you will be asked whether macros should be enabled (=run mode) or disabled (=design mode).

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

    Re: Create a Command Button (Word 2002)

    Make sure you're back in design mode.
    Right click the command button and select Properties from the popup menu.
    Now, you can modify several properties:
    <UL><LI>The Name property is how you refer to the button in VBA code.
    <LI>The Caption property is the text displayed on the button.
    <LI>Other properties that you might change are Font (click the Builder button (the three dots) to do so) and Accelerator (a character that will be underlined; Alt+character can be used to activate the button from the keyboard).[/list]HTH

Posting Permissions

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