View Single Post
  #2   Report Post  
Posted to microsoft.public.word.newusers
Klaus Linke Klaus Linke is offline
external usenet poster
 
Posts: 413
Default Styles incorrectly inheriting from another style in tables

Hi Christopher,

I'm sure you know that some text can be formatted with a paragraph style and a character style at the same time.

Unfortunately, Word2002 introduced a new concept, linked styles. A paragraph style and a character style can be linked, so that when you apply the paragraph style to part of a paragraph, Word automatically applies the linked character style.
Word will also automatically create a character style linked to the paragraph style when you apply the paragraph style to part of a paragraph... which mostly isn't anything you do on purpose, but which is pretty much impossible to prevent from happening accidentally if you are not very careful, especially if you format text in tables.

On top of this mess, paragraph styles seem to become linked to paragraph styles for no good reason at all. I don't know how this happens, but cleaning up docs is a big part of my job, and I often get docs where custom or built-in character styles (say the HTML styles for code, acronyms, examples, definitions, ...) are linked to paragraph styles haphazardly.

One thing you can do, if you haven't done so already, is to install the latest updates for your version, or move to Word2007.
I haven't seen as many issues with linked styles in docs that came from current 2003 installations or Word 2007 as I used to in Word 2002.

If it happens again, open the VBA editor (Alt+F11), go to the immediate window (Ctrl+G).
Type
? ActiveDocument.Styles("myProblematicStyle").LinkSt yle
using the names of the two problematic styles (... one of them is likely a character style, the other a paragraph style), and hit the Return key at the end of the line.

If you find the styles are linked to each other (that is, the line above returns the paragraph style for the character style and vice versa), you can remove the link by linking the paragraph style [!!] to the "Normal" paragraph style:
ActiveDocument.Styles("myProblematicStyle").LinkSt yle=ActiveDocument.Styles(wdStyleNormal)
(You'd expect you would have to link the character style to "Normal", but it works the other way around. Doing it for both styles shouldn't hurt, I guess).

Doing the above should not destroy any formatting (... no guarantees ....), but once you unlink the styles, Word will display the character style that is actually applied, which it previously hid (displaying only the linked paragraph style in the styles dropdown and styles pane).
So now it should be easy to clean up the mess, replacing the character style with the "Default Paragraph Font" or some actually sensible character style.

Regards,
Klaus



"christophercbrewster via OfficeKB.com" u3143@uwe wrote:
I got some bizarre formatting behavior recently, twice. Both problems
occurred in tables but they involved paragraph styles. A group of styles
somehow took one bit of formatting from another style. The other style had
nothing to do with the ones that were affected-- no inheritance etc, and
never used in a table. The first time I couldn't remedy it until I did "Clear
formatting" on a paragraph. Then the style shown for that paragraph changed
from its assigned style to the unwanted style-- it was somehow buried "under"
the correct one and affecting it. Fortunately I didn't need the unwanted
style for anything else, so I deleted it and the problem went away. Then
something similar happened to some other paragraphs, also in tables, and a
whole other unwanted style was affecting them. I solved that one the same way.
Again I can't find an inheritance relationship, and the unwanted style has
not been used in tables. Any ideas about what this is?

--
Christopher Brewster
Lockheed Martin, Eagan MN

Message posted via http://www.officekb.com