Emulating state toggle buttons (Word 2000) 
Author Message
 Emulating state toggle buttons (Word 2000)

I'm trying to emulate some of the toolbar buttons that show the
current state, for example, the Bold button that shows when the
insertion point is in an area that had Bold formatting applied.  In
this case, I want a button that shows me the current state of
ActiveWindow.View.ShowHiddenText.  After searching the online help,
Microsoft's Knowledge Base, MSDN, and Google's Usenet archives, plus
fiddling around on my own <g>, I'm left with a question.

How the heck do I modify the state of this button depending on which
document is active?  The macro, toolbar, and button are all in
Normal.dot; I don't want to add anything to individual documents.
(I'd also like this to work with documents opened read-only.)  I know
how to update the button on open & new, but how do I fire it off when
somebody switches to another document?



Sat, 24 Sep 2005 02:29:01 GMT  
 Emulating state toggle buttons (Word 2000)
Hi, Joe,

Have a look at the VBA Help topics on the WindowActivate and
WindowDeactivate event procedures. Also follow the link there to "Using
Events with the Application Object" to see the plumbing you need to make it
work.

--
Regards,
Jay Freedman
Microsoft Word MVP          FAQ: http://www.mvps.org/word

Quote:

> I'm trying to emulate some of the toolbar buttons that show the
> current state, for example, the Bold button that shows when the
> insertion point is in an area that had Bold formatting applied.  In
> this case, I want a button that shows me the current state of
> ActiveWindow.View.ShowHiddenText.  After searching the online help,
> Microsoft's Knowledge Base, MSDN, and Google's Usenet archives, plus
> fiddling around on my own <g>, I'm left with a question.

> How the heck do I modify the state of this button depending on which
> document is active?  The macro, toolbar, and button are all in
> Normal.dot; I don't want to add anything to individual documents.
> (I'd also like this to work with documents opened read-only.)  I know
> how to update the button on open & new, but how do I fire it off when
> somebody switches to another document?



Sat, 24 Sep 2005 04:06:43 GMT  
 Emulating state toggle buttons (Word 2000)
Word fires a number of trappable events including WindowActivate and
WindowSelectionChange which might provide enough information for what you want.


Quote:
> I'm trying to emulate some of the toolbar buttons that show the
> current state, for example, the Bold button that shows when the
> insertion point is in an area that had Bold formatting applied.  In
> this case, I want a button that shows me the current state of
> ActiveWindow.View.ShowHiddenText.  After searching the online help,
> Microsoft's Knowledge Base, MSDN, and Google's Usenet archives, plus
> fiddling around on my own <g>, I'm left with a question.

> How the heck do I modify the state of this button depending on which
> document is active?  The macro, toolbar, and button are all in
> Normal.dot; I don't want to add anything to individual documents.
> (I'd also like this to work with documents opened read-only.)  I know
> how to update the button on open & new, but how do I fire it off when
> somebody switches to another document?



Sat, 24 Sep 2005 04:40:17 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Using a button to toggle between states

2. Change the state of a toggle button without running the click event

3. Repost: (workaround no good) Change the state of a toggle button without running the click event

4. Toggle Button State

5. How to toggle between button states on click?

6. state of a toggle button

7. How to specify the state of a toggle button

8. Option groups and toggle button behavior using the keyboard (Access 2000)

9. Toggle state On/Off?

10. Word Toggle Buttons


 
Powered by phpBB® Forum Software © phpBB Group