andreas
Mon May 05 22:15:59 PDT 2008
On May 5, 4:01=A0am, Jay Freedman <jay.freed...@verizon.net> wrote:
> On Sun, 4 May 2008 14:49:17 -0700 (PDT), andreas <andreas.her...@gmx.de> w=
rote:
> >Dear Experts:
>
> >I'd like to delete all custom-defined paragraph styles in a document.
> >All these user defined paragraph styles have the following syntax
> >(*_Diss). How can I delete all theses styles in one go using Word VBA.
>
> >Help is appreciated. Thank you very much in advance.
>
> >Regards, Andreas
>
> Sub Delete_Diss()
> =A0 =A0 Dim myStyle As Style
> =A0 =A0 For Each myStyle In ActiveDocument.Styles
> =A0 =A0 =A0 =A0 If LCase(Right(myStyle.NameLocal, 5)) =3D "_diss" Then
> =A0 =A0 =A0 =A0 =A0 =A0 myStyle.Delete
> =A0 =A0 =A0 =A0 End If
> =A0 =A0 Next
> End Sub
>
> I prefer to use the LCase function to guard against possible differences i=
n the
> cases of the characters, for example, if the 'd' was upper case in some st=
yles
> but lower case in others.
>
> --
> Regards,
> Jay Freedman
> Microsoft Word MVP =A0 =A0 =A0 =A0FAQ:
http://word.mvps.org
> Email cannot be acknowledged; please post all follow-ups to the newsgroup =
so all may benefit.
Jay,
thank you very much. It is working fine.
Regards, Andreas