Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to remove all embedded formatting

Status
Not open for further replies.

PogoWolf

Programmer
Mar 2, 2001
351
US
Hey all,
I have a document that's been modified to use a buch of different formats, but has removed most the default format options in 'Style' Tool bar.

How does one go about deleteing ALL these 'special' formats and bring back the default Word options in the style bar?

I've tried clicking on the AA icon in the style toolbar, selecting a format, and deleteing it that way.. But, the delete option from the drop down is disabled.

Thanks!


The PogoWolf
 
Please tell us what version you are using.

Gerry
 
Go to the Tools menu and select Templates and addins, then click on the Organizer button. In the Styles section highlight and delete all the styles you don't want in your document. If you don't want Word to keep track of formatting changes (and I think it is a pain) then go to the Tools menu and select Options, click the Edit tab and remove the tick against Keep Track of formatting. HTH
 
Thanks, MoiraT
I have done that, and I can't delete all the changed styles. Word says 'The default *Style* can not be deleted'

I believe that means that the styles are modified versions of the 'normal' styles..

But I want to revert BACK to the normal syles, and remove all this extra 'fluff' from the document.

The PogoWolf
 
Yeah the default style cannot be deleted nor can Normal or heading styles. But any styles developed by the user can be deleted. If you have a set of standard styles, say in your Normal template, or in another document you can use the Organizer to copy these into your "fluffy" document which will override any changes made to these styles by the user. HTH
 
Code:
Sub RemoveNonBuiltinStyles()
Dim aStyle As Style
Dim NotBuiltinStyle() As String
Dim var
Dim i As Integer

On Error Resume Next
For Each aStyle In ActiveDocument.Styles
    If aStyle.BuiltIn = False Then
        ReDim Preserve NotBuiltinStyle(i)
        NotBuiltinStyle(i) = aStyle.NameLocal
        i = i + 1
    End If
Next
i = 0
   For var = 0 To UBound(NotBuiltinStyle)
    ActiveDocument.Styles(NotBuiltinStyle(i)).Delete
    i = i + 1
Next
End Sub

will remove all non-builtin styles.

Gerry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top