Paste your code, Donna. That way, it's easier for someone to edit it, than
to write it all over again.
************
Anne Troy
www.OfficeArticles.com
>i am trying to delete few style from activedocument. The macro is in one of
> the template and people create new document from there. At the end of
[quoted text clipped - 8 lines]
>
> Any help
Application.OrganizerDelete Source:=ActiveDocument, Name:="Abstract",
Object:=wdOrganizerObjectStyles
Application.OrganizerDelete Source:=ActiveDocument, Name:="Indent",
Object:=wdOrganizerObjectStyles
Application.OrganizerDelete Source:=ActiveDocument, Name:="Caption",
Object:=wdOrganizerObjectStyles
Application.OrganizerDelete Source:=ActiveDocument, Name:="Caption
(Cont'd)", Object:=wdOrganizerObjectStyles
Application.OrganizerDelete Source:=ActiveDocument, Name:="Center",
Object:=wdOrganizerObjectStyles
Application.OrganizerDelete Source:=ActiveDocument, Name:="hidden",
Object:=wdOrganizerObjectStyles
I'm attaching the coding.
> Paste your code, Donna. That way, it's easier for someone to edit it, than
> to write it all over again.
[quoted text clipped - 14 lines]
> >
> > Any help
Jean-Guy Marcil - 26 Oct 2005 19:04 GMT
donna was telling us:
donna nous racontait que :
> Application.OrganizerDelete Source:=ActiveDocument, Name:="Abstract",
> Object:=wdOrganizerObjectStyles
[quoted text clipped - 10 lines]
>
> I'm attaching the coding.
'_______________________________________
Sub CleanUpStyles()
DeleteStyle "Caption"
DeleteStyle "Indent"
DeleteStyle "Caption"
DeleteStyle "Caption (Cont'd)"
DeleteStyle "Center"
DeleteStyle "hidden"
End Sub
'_______________________________________
'_______________________________________
Function DeleteStyle(StyleName As String)
On Error GoTo StyleDeleted
ActiveDocument.Styles(StyleName).Delete
Exit Function
StyleDeleted:
Err.Clear
MsgBox "The style """ & StyleName & """ has " _
& "already been deleted.", vbExclamation, _
"Style not in list"
End Function
'_______________________________________

Signature
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org
Jean-Guy Marcil - 26 Oct 2005 19:18 GMT
Jean-Guy Marcil was telling us:
Jean-Guy Marcil nous racontait que :
> donna was telling us:
> donna nous racontait que :
[quoted text clipped - 43 lines]
> End Function
> '_______________________________________
Ooops..
Of course, replace the first
DeleteStyle "Caption"
with
DeleteStyle "Abstract"

Signature
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org