Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-21-2021, 05:56 AM
Ulodesk Ulodesk is offline A strange encounter with "overlay" styles Windows 10 A strange encounter with "overlay" styles Office 2016
Word 2013 Expert Cert
A strange encounter with "overlay" styles
 
Join Date: Sep 2009
Location: Virginia
Posts: 810
Ulodesk is on a distinguished road
Default A strange encounter with "overlay" styles

I had a new experience while working on a 100-page-plus proposal document recently that perhaps someone can explain. I would also like to ask whether a macro could fix such problems, though I expect the issue may get too thorny for a single one.



We work in Word 365 on SharePoint, though I don’t think that was the issue here, except for inexperienced hands messing things up in the first place.

We use Word’s autonumbering for captions, by way of References/Insert Caption, but then apply our own paragraph style to captions, rather than using Word’s built-in Caption style. Our style, one of a list of defined custom paragraph styles in a custom template, is bold-italic. However, our Table of Figures (TOF) style is regular, with neither bold nor italic.

In one large part of the document, not an actiual separate Word section, we were locally formatting the caption font size down from 12 to 10 to match text size in multi-page tables, and this is where the problem was occurring.

I noticed that some captions were appearing as bold in the TOF; in others, only the number or Figure xx were in bold. Assuming a character style “overlay” (applied on top of the para style), I tried clearing this with Ctrl+spacebar, and Ctrl+Q, even using the Clear All style, but to no avail—regenerating the TOF came up the same. Closing the doc and reopening after refreshing the web page solved nothing.
While I did find that clearing and leaving the font size at 12 when refreshing the TOF resolved the problem, this was not an option, and I have no idea why this should make the difference.

I finally managed to clear everything except the numbers on a remaining half-dozen entries, which remained bold.

Long story short, what finally worked was 1) selecting only the auto number in the caption, applying a paragraph style that had neither bold nor italic (and, in fact, was in a different font); 2) with nothing selected, reapplying our caption style; 3) selecting only the pilcrow and removing the bold with Ctrl+B.

I know that the pilcrow holds paragraph info. What I don’t understand is why the usual clearing methods didn’t work and why this did. Any thoughts?

Finally, regarding a macro: I wonder if a macro could be written to clear “overlay” styles without removing wanted character styles. Perhaps such a macro would have to specify the paragraph style to be worked on and used one pass at a time, as well specifying character style(s) to be left alone. In our case, we have a bold character style, typically used for lead-in words in a paragraph, but hyperlink might be another to be left alone. I’m guessing there is an if/then condition that could be used. However, I don’t know if this would also strip local formatting, e.g., bold, italic, not applied as either para or character style.
__________________
Sine scientia ars nihil est
Reply With Quote
  #2  
Old 09-21-2021, 06:48 PM
Guessed's Avatar
Guessed Guessed is offline A strange encounter with "overlay" styles Windows 10 A strange encounter with "overlay" styles Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 2,638
Guessed is a splendid one to beholdGuessed is a splendid one to beholdGuessed is a splendid one to beholdGuessed is a splendid one to beholdGuessed is a splendid one to beholdGuessed is a splendid one to beholdGuessed is a splendid one to behold
Default

Sounds like you have character styles in your captions. I don't know why Ctrl-Space and Ctrl-Q didn't work. Normally that would remove all local formatting AND character styles from the selection. If it didn't then perhaps your field or text is protected.

There is a command to remove all local font formatting (local and character style)
Selection.Font.Reset

And a different command to remove local but retain character styles
Selection.ClearCharacterDirectFormatting 'Retain character styles
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #3  
Old 09-22-2021, 04:23 AM
Charles Kenyon Charles Kenyon is offline A strange encounter with "overlay" styles Windows 10 A strange encounter with "overlay" styles Office 2019
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 7,552
Charles Kenyon has much to be proud ofCharles Kenyon has much to be proud ofCharles Kenyon has much to be proud ofCharles Kenyon has much to be proud ofCharles Kenyon has much to be proud ofCharles Kenyon has much to be proud ofCharles Kenyon has much to be proud ofCharles Kenyon has much to be proud of
Default

See the part of this page about the effect of of direct formatting on a TOC.
TOC Tips and Tricks

(A table of figures uses the TOC field.)
Reply With Quote
  #4  
Old 09-22-2021, 05:42 AM
Ulodesk Ulodesk is offline A strange encounter with "overlay" styles Windows 10 A strange encounter with "overlay" styles Office 2016
Word 2013 Expert Cert
A strange encounter with "overlay" styles
 
Join Date: Sep 2009
Location: Virginia
Posts: 810
Ulodesk is on a distinguished road
Default

Thanks to both of you. An experiment shows me that Ctrl+spacebar apparently runs Selection.Font.Reset. I don't know how to write macros (I've tried to learn a couple of times but get lost; not my forté), but perhaps I can record one and substitute the Selection.ClearCharacterDirectFormatting for whatever appears in that position.

The problem I faced will remain one of those Word mysteries. In my experience (again, not knowing background coding), there are occasions when someone(s) has managed to do something inadvertently that causes Word confusion. I suspect that some of it may be in the realm of combined char/para styles, when people paste para-styled text with an included pilcrow into the middle of a paragraph. Anyway, as with Word tables, styles can get bollixed up.

Charles, off-topic somewhat, but regarding the info in the link you sent about TOC and direct formatting, maybe I am misunderstanding something. It didn't seem to deal with styling of the TOC styles, which trump the heading style and formatting. So, for instance, if my Heading 1 is Baskerville and I locally change a few words in, say, my first such heading to Arial, but if my TOC 1 style is Calibri 11, my TOC will be in Calibri 11. At least, that's what I get when using Custom TOC, which I always do, because I style font, size, and indents in the TOC styles.
__________________
Sine scientia ars nihil est
Reply With Quote
  #5  
Old 09-22-2021, 09:12 AM
Charles Kenyon Charles Kenyon is offline A strange encounter with "overlay" styles Windows 10 A strange encounter with "overlay" styles Office 2019
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 7,552
Charles Kenyon has much to be proud ofCharles Kenyon has much to be proud ofCharles Kenyon has much to be proud ofCharles Kenyon has much to be proud ofCharles Kenyon has much to be proud ofCharles Kenyon has much to be proud ofCharles Kenyon has much to be proud ofCharles Kenyon has much to be proud of
Default

Quote:
Originally Posted by Ulodesk View Post
***

Charles, off-topic somewhat, but regarding the info in the link you sent about TOC and direct formatting, maybe I am misunderstanding something. It didn't seem to deal with styling of the TOC styles, which trump the heading style and formatting. So, for instance, if my Heading 1 is Baskerville and I locally change a few words in, say, my first such heading to Arial, but if my TOC 1 style is Calibri 11, my TOC will be in Calibri 11. At least, that's what I get when using Custom TOC, which I always do, because I style font, size, and indents in the TOC styles.
Some, but not all, direct character formatting, including for this purpose character styles, will override the TOC style formatting. Suzanne's article sets it out pretty well. Formatting set in paragraph styles is ignored in the TOC entry.


Quote:
Important Note: Not all direct formatting is reflected in the TOC. Paragraph formatting is always ignored. This means that if your Heading 1 is defined as 12 points Spacing Before and 3 points Spacing After and you modify one Heading 1 paragraph to have 24 points Spacing Before, this will not affect the TOC. Only direct font formatting is picked up, and not even all of that; here's a rundown:
  • Font formatting that is picked up by the TOC: the font itself (font name), italics, bold, superscript/subscript, strikethrough/double strikethrough, small caps/all caps, hidden, raised/lowered, expanded/condensed, scaled.
  • Font formatting that is NOT picked up by the TOC: font size, font color, underline.

The above certainly applies to the "Custom" TOC. It was written before building blocks existed and it applies to anything generated by a TOC field.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tool to visualize STYLEs and "micro-styles" anslee7 Word 1 11-17-2020 04:43 PM
Unable to customize ribbon, remove "Cell Styles" pjs15 Excel 1 08-21-2020 08:01 AM
Keeping or restoring "Start at" value for heading list after updating styles from a template WordUser789 Word VBA 9 04-15-2019 12:16 AM
Can't Display "Recently Used Styles" in Styles Pane mwildem Word 2 05-23-2012 01:42 PM
A strange encounter with "overlay" styles How to choose a "List" for certain "Heading" from "Modify" tool? Jamal NUMAN Word 2 07-03-2011 03:11 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:50 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2021 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft