Hidden surprise using Hidden text

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15498
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

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:
An expensive day out: Wallet and Grimace

User avatar
HansV
Administrator
Posts: 78237
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!
Best wishes,
Hans

User avatar
macropod
4StarLounger
Posts: 508
Joined: 17 Dec 2010, 03:14

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
[Fmr MS MVP - Word]

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15498
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

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
An expensive day out: Wallet and Grimace