Office & Productivity Software forum

General discussion

How to add a feature to my macro button

by stan / July 3, 2004 5:00 AM PDT

Hi
WinXP-sp1
Office 2003

You guys know how the Show/Hide button works, right. When you click it the Paragraph mark displays and the button remains highlighted. Then when you click it again the Paragraph mark goes away and the button is no longer highlighted.

I want to know what VBA code I can use to give that same kind of functionality to macro buttons that I create.

Thanks

Discussion is locked
You are posting a reply to: How to add a feature to my macro button
The posting of advertisements, profanity, or personal attacks is prohibited. Please refer to our CNET Forums policies for details. All submitted content is subject to our Terms of Use.
Track this discussion and email me when there are updates

If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.

You are reporting the following post: How to add a feature to my macro button
This post has been flagged and will be reviewed by our staff. Thank you for helping us maintain CNET's great community.
Sorry, there was a problem flagging this post. Please try again now or at a later time.
If you believe this post is offensive or violates the CNET Forums' Usage policies, you can report it below (this will not automatically remove the post). Once reported, our moderators will be notified and the post will be reviewed.
Collapse -
Macro recording.
by Kees Bakker / July 3, 2004 5:29 AM PDT

Stan,

Start macro recording, do what you want to do, end macro recording, and edit the macro to view how Word does it. Then do it the same way.


Kees

Collapse -
I already know that. I'll restate my question
by stan / July 3, 2004 6:25 AM PDT
In reply to: Macro recording.

I want to be able to toggle to button that the macro is assigned to. I mean if I click it the the button will stay highlighed much like the show/hide paragraph button. And when i and done I want to be able to click the same button to undo what I use it to do in the first place ( much like the Show/Hide button can toggle the paragraph button on and off).

At present I have to use two buttons(i placed them next to each other though) to accomplish my task. One button to DO and the other to UNDO.

I want one button alone. Another analogy would be to liken its functionality to that of a check box. check to enable, uncheck to disable, which is how the show/hide button works by the way.

thanks though.

Collapse -
Re: I already know that. I'll restate my question
by R. Proffitt Forum moderator / July 3, 2004 6:45 AM PDT

That's easy, but I'll share the psuedocode for it and you can fix it...

begin macro_stan

if (doc.showall=True) then doc.showall=False else doc.showall=True

end macro_stan

You get the idea.

Bob

Collapse -
(NT) (NT) THANKS SO MUCH!! It worked excellently
by stan / July 3, 2004 7:13 AM PDT
Collapse -
good tutorials
by puters2468 / August 21, 2007 2:14 PM PDT
In reply to: Macro recording.

asking for good tutorials on recording macros in Microsoft Word.

Collapse -
Re: tutorials for recording macro's
by Kees Bakker / August 21, 2007 7:35 PM PDT
In reply to: good tutorials
Popular Forums
icon
Computer Newbies 10,686 discussions
icon
Computer Help 54,365 discussions
icon
Laptops 21,181 discussions
icon
Networking & Wireless 16,313 discussions
icon
Phones 17,137 discussions
icon
Security 31,287 discussions
icon
TVs & Home Theaters 22,101 discussions
icon
Windows 7 8,164 discussions
icon
Windows 10 2,657 discussions

CNET FORUMS TOP DISCUSSION

Help, my PC with Windows 10 won't shut down properly

Since upgrading to Windows 10 my computer won't shut down properly. I use the menu button shutdown and the screen goes blank, but the system does not fully shut down. The only way to get it to shut down is to hold the physical power button down till it shuts down. Any suggestions?