View Single Post
 
Old 03-21-2014, 02:31 PM
macropod's Avatar
macropod macropod is offline Windows 7 32bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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

Hi glowackt,

Your issues are quite different from those described in the original thread, so I've separated this discussion into a new thread. It seems you don't necessarily want to hide the macrobuttons at print time (not sure about this) but that you want to use them to conditionally hide/show content in certain ranges.

I must say at the outset that I don't see that what you're trying to do is worth the effort, given that: Word's outline view can be used to expand/collapse the document; a Table of Contents to quickly navigate to areas of interest; and the document window can be split to allow different areas to be viewed at the same time.

I note you're using bookmarks to identify the ranges to be expanded/collapsed. I'd suggest using Section breaks instead, as bookmarks are quite fragile, in addition to which it's easy to unintentionally insert content outside a bookmarked range. With a little forethought, this would also mean you could use a single show/hide macro for all the macrobutton fields.

As for reading the 'saved' options for the macrobutton fields, the simplest way is to save the document with the show/hide state the user had in place; otherwise you'd need an elaborate set of document properties/variables that would be read and processed when the document is opened, alongside also ensuring the document can't be saved in any state other than what you want. Since the outcome would be the same in terms of what is seen when the document is opened, nothing is achieved for all that circumlocution.

A macro to unhide all the document content is trivial:
Code:
Sub Unhide()
ActiveDocument.Range.Font.Hidden = False
End Sub
PS: When posting code, please use the code tags. They're on the 'Go Advanced' tab.
PPS: You can attach docm files by adding them to a zip archive beforehand, then attaching that.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote