Remove Styles

J

Jim

I have a long document with multiple Word Styles. The company I am
working with is clueless as to how to work with them and asked me to
remove them

Is there a way to "remove" the styles from the document while having
the underlying text maintain the formatting of the styles.
 
M

macropod

Hi Jim,

If you're referring to the built-in Styles, you can't remove them. A far better approach is to demonstrate the power of Styles to
the company and, when the light bulb brightens, teach the workers how to use them.
 
J

Jim

Thanks . Actually I was referring to styles I added nit the default
built in styles

In terms of the power of styles although I agree it would be nice I do
find that using styles with multi-level lists (which is what I did) to
be somewhat cumbersome. It would be a hard sell

Thanks for your help

FYI I tried the VBA command
ActiveDocument.Styles("Custom1").Delete

but that genereate a vba error
 
M

macropod

Hi Jim,

You could try something based on:

Sub Demo()
Dim Sty As Style
For Each Sty In ActiveDocument.Styles
If Sty.BuiltIn = False Then Sty.Delete
Next
End Sub

Unfortunately, you lose all of the formatting associated with the deleted Styles in the text that used them.

What you can do, however, is to delete all the Styles that aren't being used, leaving only the used ones to process. For this you
could try something based on:

Sub Demo()
Dim Sty As Style
With ActiveDocument
For Each Sty In .Styles
If Sty.BuiltIn = False Then
With .Content.Find
.ClearFormatting
.Text = ""
.Style = Sty.NameLocal
.Execute Format:=True
If .Found = False Then
Sty.Delete
Else
MsgBox "Style: " & Sty.NameLocal & " is in use."
End If
End With
End If
Next
End With
End Sub

From there it's be a matter of using Find to locate each use of the reported 'in use' Styles, capturing the relevant attributes,
changing the range's Style to a suitable built-in Style and then either modifying that Style to suit or hard-formatting the range
with the formerly-applied Style's attributes. Once that's done for all ranges in that Style, the Style can safely be deleted.
 
P

Pamelia Caswell via OfficeKB.com

It may help you to reverse what I do to clean up documents when, as in your
case, wiping out all formatting is not an option.

Turn on keep track of formatting in Word options and go to styles pane >
Options (in W2007). In the section of the dialog that says "formatting to
show as styles" put a check in the box before Paragraph level formatting.

Create a normal paragraph and apply formatting (say 14 pt bold ) that is the
same as one of your user-defined styles. An entry will appear in the style
pane that says something like "+ 14 pt bold" ("Normal" does not always
appear. For other styles with manual formatting, the style name always
appears before the plus sign.)

In the styles pane, select all instances of the user-defined style you
duplicated, then apply the normal + formatting you just created.

Do this for any style that you want to change to normal + formatting.

Note that this will break your heading numbering, so my may want to convert
those numbers to text before you begin. As an aside, I have found that
using multilevel list numbering linked to styles, though sometimes tricky to
set up, is a reliable and easy way to apply and fix heading numbering.

HTH,
Pam
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top