View Single Post
 
Old 10-05-2014, 08:59 AM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

That approach is a quite unreliable way of hiding content in a document. It does not, in fact expand/collapse anything. All it does is to toggle the font's hidden state for the bookmarked range. Whether it actually works depends on how the user has Word configured. If the user has Word configured to show hidden text (which is what most users who can see Word's formatting marks would have) or, even if the text does hide, whether that text gets printed, is entirely beyond the macro's control - it all depends on Word's configuration.

In answer to your question, though, yes, you'd need a separate macro for each MACROBUTTON field. A single macro could handle multiple bookmarked ranges, though.

To conditionally expand/collapse a document, you really need to control what is in it, not the font properties. See, for example:
https://www.msofficeforums.com/word-...html#post60848
https://www.msofficeforums.com/word-...own-lists.html
https://www.msofficeforums.com/word-...own-field.html
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote