Holy Togglin' Macros!!!

R

Ron

I've recorded a macro that simply makes my hidden text visible. Now I want
to assign the macro to a toolbar button AND get the button to toggle the
visibility of the hidden text. How can I do that?

Thanks in advance.
 
J

Jezebel

To assign the macro: right-click any toolbar. Select Customize. On the
Commands tab select 'Macros' from the left-hand list, and then your macro
from the right-hand list. Drag it your toolbar of choice.

To make it toggle, edit the macro code to something like

selection.Font.Hidden = not selection.Font.Hidden
 
R

Russ

Ron,
See Below.
To assign the macro: right-click any toolbar. Select Customize. On the
Commands tab select 'Macros' from the left-hand list, and then your macro
from the right-hand list. Drag it your toolbar of choice.

To make it toggle, edit the macro code to something like

selection.Font.Hidden = not selection.Font.Hidden

Did you know that the Show/Hide Button (¶) in the standard toolbar can
toggle all hidden text visible and not visible? And that hidden text will
not normally print unless that particular option is selected beforehand
under Tools | Options | Print? Sometimes PrintPreview mode will show less
total pages than the other view modes because it repaginates without the
hidden text taking up space.

One useful function of hiding certain parts of text is to exclude that
hidden text from being used in a sorting process. After the sort is done,
you might choose to change the hidden text back to regular text.
 
J

Jezebel

What!? The Show/Hide button toggles the display of non-printing characters
(paragraph marks, tabs, spaces). It has nothing to do with hidden text.
 
G

Graham Mayor

It toggles the *display* of hidden text also - provided it is not checked
for display in tools > options > view.
However if you only want to toggle the *display hidden text option* then a
macro option is the better approach, in this case.

With ActiveWindow.View
.ShowHiddenText = Not .ShowHiddenText
End With

If you need to print the hidden text you could add that option (set both
options manually to the same setting first).

With Options
.PrintHiddenText = Not .PrintHiddenText
End With

- but then the setting of the font attribute as you originally suggested
could be the better choice, though you would need to select your range
first..
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top