• Removing Styles in Bulk (Word 2002)

    Author
    Topic
    #414954

    Is there any way to “Remove all styles not in use in the current document” or whatever.

    I recently “inherited” an almost 100 page document. This had originally be written by about a dozen people and pieced together to form a “Handbook”. Most of the original authors had no idea of how to format, etc. and used tons of makeshift things to get their part of the document to appear correct. Now, with the revision I am doing, I removed all of their makeshift formatting and reformatted it with headings, proper paragraph spacing, bullets and numbering, etc. This has made it a much nicer document and, of course, when editing, things don’t seem to suddenly go haywire.

    My problem is that in the style box, there must be at least 150 different entries. At least. I know I can delete each style individually but to do all of these would be a real pain. I am wondering if there is some way I can do this in one fell swoop. I tried Control+A, Control +C and then pasting into a new document and then saving it with a different name, The new document had all the unused styles transferred with it.

    I am also curious. Do all these styles make it a larger document. It is now about 4 MG and it seems way too big. Yes, I have pictures in it. But I pasted them in as JPGs and then, to try to make them even smaller, I used the compress picture feature. All the pictures are also in grayscale.

    Thanks for any and all help anyone can give me

    Viewing 1 reply thread
    Author
    Replies
    • #924187

      See if the Macro in post 152037 works for you.

      StuartR

      • #924773

        Here’s another macro… You could remove the message boxes, but I prefer to check which styles are deleted/kept.

        Sub DeleteUnusedStyles()
         Dim myStyle As Style
         For Each myStyle In ActiveDocument.Styles
          If myStyle.InUse Then
           Select Case myStyle
            Case ActiveDocument.Styles(wdStyleDefaultParagraphFont)
            Case ActiveDocument.Styles(wdStyleNormal)
            Case ActiveDocument.Styles(wdStyleNormalTable)
            Case ActiveDocument.Styles(wdStyleHeading1) To _
             ActiveDocument.Styles(wdStyleHeading9)
            Case Else
             Selection.Collapse (wdCollapseStart)
             With Selection.Find
              .ClearFormatting
              .Style = myStyle
              .Forward = True
              .Wrap = wdFindContinue
              .Execute FindText:="", Format:=True
              If .Found = False Then
                StatusBar = myStyle.NameLocal
                If MsgBox("Delete?", vbYesNo, myStyle.NameLocal) = vbYes Then
                  myStyle.Delete
                End If
              Else
                If MsgBox("Keep?", vbYesNo, myStyle.NameLocal) = vbNo Then
                  myStyle.Delete
                End If
              End If
             End With
           End Select
          End If
         Next myStyle
        End Sub
        

        If you copy everything except the last paragraph mark into a new document, that should leave a lot of unused styles behind, too.
        cheers Klaus

    • #924212

      Hi, Kathie. And if you’d rather not be bothered with a macro, you can remove multiples in the Organizer. There are numerous ways to get there, but probably the fastest is Tools / Templates and Add-Ins / Organizer. It should come up with the Style tab active. Just select the user-defined styles you want to remove and click Delete.

      • #925157

        Karen — tried your suggestion (quicker for me, no macros), but I get the following error:

        The built in style “xxx” cannot be deleted.

        In my situation, I had a paragraph of style “Normal” and underlined and italicized it. When I moved away from the paragraph, it automatically changed the style type to “Heading 7.” Of course this is NOT what I wanted done (or I would have changed the style myself!). As a result, that Style was pulled from the ‘master list’ (I suppose?) of styles into my document. And I therefore cannot remove it…

        Am I overlooking the obvoius?

        And is there any way to have Word *NOT* automatically change your styles?

        thanks!
        ..dane

        ps.- I am using Word 2000 (not 2002) but felt it was similar enough a topic to piggy-back on this thread…

        • #925245

          Hi, Dane. You are correct that 2000 and 2002 are similar enough to piggy-back.

          Once Word’s built-in styles have been incorporated into a document then you have no option for removing them other than using a macro as described above. There are other work-arounds available but in that instance the macro is best.

          “is there any way to have Word *NOT* automatically change your styles?”
          yep Bless MS’s heart — they want to help you… regardless of whether you want them to or not. In the instance of Word applying Heading7 to your text you have autoformat turned on. There are all sorts of options you may want to turn off. Take a visit to Tools / AutoCorrect and look at the autoformat and autoformat as you type tabs.

          One other thing — it’s a good idea to visit the styles you use frequently and make sure that “automatically update” is turned off… don’t forget to “save to your template” while you’re there to prevent future documents from having that nasty habit.

          Good luck!

    Viewing 1 reply thread
    Reply To: Removing Styles in Bulk (Word 2002)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: