Re: Enable/Disable Toolbar button
- From: Jay Freedman <jay.freedman@xxxxxxxxxxx>
- Date: Sun, 14 Oct 2007 22:15:08 -0400
If you name your macros RestartNumbering and ContinueNumbering, then
the built-in buttons (with their automatic enable/disable behavior)
will run the macros instead of the built-in commands. The macros will
also intercept the commands on the context (right-click) menu, which
appear only when the appropriate text is clicked.
http://www.word.mvps.org/FAQs/MacrosVBA/InterceptSavePrint.htm
On Sun, 14 Oct 2007 18:33:00 -0700, NZ VBA Developer
<gordon(dot)bentleymix(at)gmail(dot)com> wrote:
Word does it, so how can I do it?
I want to enable/disable a toolbar button depending on cursor
location/selection. For example, if I put the 'Restart Numbering' and
'Continue Numbering' buttons on the 'Formatting' toolbar, Word "knows" to
enable these buttons _only_ if the current selection is numbered. Any ideas
on how to replicate this functionality for the buttons on my own custom
toolbar so the macro assigned to the button can be run only in the correct
context?
(In fact, the 'Restart/Continue Numbering' functionality is the
functionality that I want to replicate, but I can't just add the native Word
buttons to my custom toolbar because this functionality doesn't work with
protected documents. So if somebody has a clever idea for getting around
this...)
--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit.
.
- Follow-Ups:
- Re: Enable/Disable Toolbar button
- From: NZ VBA Developer
- Re: Enable/Disable Toolbar button
- Prev by Date: Re: Reg Ex Challenge
- Next by Date: Re: Reg Ex Challenge
- Previous by thread: RE: Enter Values from a ListBox
- Next by thread: Re: Enable/Disable Toolbar button
- Index(es):