Hidden surprise using Hidden text

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 10681
Joined: 24 Jan 2010, 23:23
Location: paused.undefined.exposed

Hidden surprise using Hidden text

Post by ChrisGreaves »

I must say that this caught me by surprise:

I have a training manual with the usual styles in use “Heading 1”, “Heading 2”, “Body Text” and so on.
I made a new style “AStudent: which I used to format paragraphs that summarized the keytrokes covered in the section. I had a vague idea that I could produce a one-page summary of the keystrokes covered in class; sometimes called a “cheat-sheet”.
I then modified the style (Modify, Format, Font, Hidden) to see how neat the manual looked without the keytroke reminders.
Pretty Good.

Without thinking I ran one of my macros “Delete Unwanted Styles”, which works by looping through every style in the document, and issuing an Edit-Find for document text set in that style. If text in that style is not found, well, obviously the style isn’t being used so the macro can delete the style definition.

Great. Now I have a less bloated document because a hundred or so unwanted styles have been removed.

Including, it turns out. “AStudent”
And yes, you have guessed the consequences, but I had not:

The style had its Font changed to Hidden.
This Hid the text.
So the text was Not Found by my (programmed) Edit-Find.
So No Text Used that style.
So the style was DELETED !

I found this out only when I’d finished patting myself on the back, and went to unhide the text by modifying the style “AStudent” (Modify, Format, Font, NOT Hidden) only to find that the style (doh!) had been deleted.
And my normally attractive keystroke summaries had been reduced to Plain-Jane Normal style and boring text.

Cheers
Chris :blush:
Science is a journey with no destination

User avatar
HansV
Administrator
Posts: 67739
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Hidden surprise using Hidden text

Post by HansV »

Yep, that can catch you unawares!
Regards,
Hans

User avatar
macropod
4StarLounger
Posts: 441
Joined: 17 Dec 2010, 03:14
Status: Microsoft MVP

Re: Hidden surprise using Hidden text

Post by macropod »

It would have been found had you had Word configured to display hidden text. You might want to update your macro to do that.
Paul Edstein
[MS MVP - Word]

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 10681
Joined: 24 Jan 2010, 23:23
Location: paused.undefined.exposed

Re: Hidden surprise using Hidden text

Post by ChrisGreaves »

macropod wrote: You might want to update your macro to do that.
Agreed. I should at least test each style within the loop:-
"If this style has Format=Hidden, be careful"
Cheers
Chris
Science is a journey with no destination