I guess I wasn't really explicit enough about what I need to do...
My problem is that I'm compiling extracts from a document (in the same
document, like a TOC). They are roughly sentence-length. They need to have
a new paragraph style applied, but any <intentional> direct formatting
retained (e.g. Bold, Italic, EmphasisCharStyle). So far so good
(TargetRange.FormattedText = SourceRange.FormattedText; apply Par Style,
etc.)
The problem comes in when there is <unintentional> direct formatting
applied -- viz, when a paragraph style had been applied to a text run
<without> a paragraph mark, and Word has helped us out by creating a
"Heading 1 Char" type of style (linked style). In that case, the text
retains all of the properties of "Heading 1", including Font.Name,
Font.Size, etc.. We are looking for a clean way to locate these runs in our
copied text, and fix them up (e.g. by resetting the direct formatting to
clear the Character Style, and re-applying the few properties which we
actually need to retain, such as Italic.)

Signature
Fletcher James
President
Levit & James, Inc.
(703)771-1549
MailTo:fjames@levitjames.com
http://www.levitjames.com
> G'day "Fletcher James" <fjames@levitjames.com>,
>
[quoted text clipped - 51 lines]
>>
>>A direct cc: to me, in addition to a reply-to-group, would be appreciated.
Klaus Linke - 29 Sep 2005 21:34 GMT
Hi Fletcher,
I think the macro from
http://groups.google.com/group/microsoft.public.word.docmanagement/browse_frm/th
read/d480035f4b14be0e/d9f49b2f7b5119a9
will do that.
Look at the comments ("To only remove Char styles:").
As soon as you delete the Char style, the font formatting will be reset. I'm
afraid you might loose manual font formatting applied on top of the Char
style.
If that is a problem, you'd need to "tag" the font formatting you want to
keep (say replace bold text with <b>^&</b>), clean out the Char styles, and
then reapply the bold if necessary (= search \<b\>(*)\</b\> and "not bold"
with a wildcard replacement, replace with \1 and "bold", then do the same
without formatting to get rid of the rest of the tags).
Regards,
Klaus
>I guess I wasn't really explicit enough about what I need to do...
>
[quoted text clipped - 76 lines]
>>>A direct cc: to me, in addition to a reply-to-group, would be
>>>appreciated.