Group: microsoft.public.word.vba.general
From: andreas
Date: Saturday, March 22, 2008 5:06 AM
Subject: Re: Cleaning out all linked "Char"-Styles in one go

On Mar 22, 8:27=A0am, "Graham Mayor" wrote:
> Have you seen -http://support.microsoft.com/kb/902064
>
> --
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> Graham Mayor - =A0Word MVP
>
> My web sitewww.gmayor.com
> Word MVP web sitehttp://word.mvps.org
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>
>
>
> andreas wrote:
> > Dear Experts:
>
> > =A0 Below code which I found on the Internet creates a new style
> > ("Style1"), links the "Char" style that bases on "Heading 2" to this
> > new style, then deletes the new style.1.
> > This way one can easily get rid of these awful linked character
> > styles. These rogue characther styles (e.g. Heading 1 Char Char) are
> > automatically created if one tries to apply a paragraph style to just
> > part of a paragraph.
>
> > The trouble is, I got a document which has literally hundreds of these
> > (rogue) linked Character Styles. Is there a way to alter below code to
> > include all linked "Char" Styles regardless of their exact name (e.g.
> > Heading 1 Char Char Char or Table Body Text Char Char Char Char or
> > just Char Char).
>
> > Help is much appreciated.
> > Thank you very much in advance.
>
> > Regards, Andreas
>
> > Sub DeleteHeading2Char()
> > Dim styl As Word.Style, doc As Word.Document
> > Set doc =3D ActiveDocument
>
> > Set styl =3D doc.Styles.Add(Name:=3D"Style1")
> > On Error Resume Next
> > doc.Styles("Heading 2 Char").LinkStyle =3D styl
> > styl.Delete End Sub- Hide quoted text -
>
> - Show quoted text -

Dear Graham,

ok, this solves half of my problem. Thank you. In my response to Klaus
I elaborate on my initial problem.
Thank you, Regards, Andreas