Eeeewww....
You are running into the "Partially applied style" bug that has been
designed into Word.
Later versions of Word have a thing called a "Linked Style". This was the
most mind-bendingly STUPID thing Microsoft has ever done.
Needless to say, it was done on the Windows side. Needless to say, they did
it because Lawyers wanted it. But it makes a complete mockery of the entire
concept of styles. This particular horror was introduced in Word 2002, and
Mac BU has had to cope with it ever since.
What happens is this:
1) You have a document with some styles in it. Some of these styles are
Paragraph styles.
2) You have a user who does not know how to use styles properly.
3) The user selects "part" of a paragraph and applies a paragraph style.
4) What used to happen was that Word would ignore the selection and apply
the paragraph style to the whole paragraph. Lawyers hated it (they have
never understood computers, let alone word-processing, or styles).
5) So Microsoft came up with this shriekingly funny (embarrassing!)
work-around.
6) When the user does this, Word creates a NEW style. It gives it the same
name as the paragraph style, and LINKS it to the paragraph style. Into this
new style, which is in fact a Character style, Word copies the Character
properties of the original style (by reference). This new spawn of the
devil is known as a "Linked Style".
7) It is nearly impossible in VBA to discover that you are looking at a
linked style. It has the same name, and the Type indicators for both
"Paragraph" and "Character" are true!
You CAN sort this out in the code. I can give you a VBA solution, but I
can't convert it into AppleScript for you.
What I would recommend is that you train your users NOT to do this. Give
them proper Character styles to use when they want inline format changes.
In Word 2003/7 you can disable Linked Styles. This function is not
available in Mac Word. However, if you turn off "Keep track of formatting"
in the Edit preferences, Word is much less likely to create linked styles.
It can still use them if they already exist in the document, but it should
not create any.
Hope this helps
Also,
Saving down to rtf or docx and reopening does not fix the issue.
--
Don't wait for your answer, click here:
http://www.word.mvps.org/
Please reply in the group. Please do NOT email me unless I ask you to.
John McGhie, Microsoft MVP, Word and Word:Mac
Nhulunbuy, NT, Australia. mailto:
[email protected]