Advice on cleaning up a Word document

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Advice on cleaning up a Word document

Post by Rudi »

I have a large legal document that is styled in a specific legal format using custom styles and paragraph numbering. As with many large documents that have been reviewed and past through many hands, there is a mess of "sub" styles where it lists Heading 1 + Bold+ Line Spacing, etc... in the Styles list. Also, paragraphs do not seems to link to their appropriate styles (for example, I click on a second level paragraph, and it shows the Heading 1 style activate in the gallery on the home tab). lastly, Outline numbering is out... I enter to create a sub point in the main numbering of 3. and the number that gets generated is 2.1 instead of 3.1.

My question is this...
What is the best route to follow to "clean" up this document?
-- Select ALL and clear formats by assigning Normal style to it...and starting afresh? Not really wanting to as the doc is about 50 pages long.
-- Work paragraph at a time and reformat to new clean styles
-- Delete ALL unused styles and relink data to appropriate styles
-- etc...

Can I get some thoughts and ideas...maybe some tips and tricks on cleaning up the document, the styles and the numbering?

Many TX.
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

User avatar
HansV
Administrator
Posts: 78457
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Advice on cleaning up a Word document

Post by HansV »

With really messy documents, what works best for me - unpleasant as it may be - is to copy the entire document (Ctrl+A, then Ctrl+C), then paste it as plain text into a blank new document.
Create only the strictly necessary styles in the new document.
Keeping the old and new document open side by side, work through the new document and apply styles as needed.
Any pictures, shapes etc. will have to be copied from the old document into the new one.
Page setup will have to be redone.
A lot of work, but in the end more efficient than trying to repair a 'mutilated' document, in my experience.
Best wishes,
Hans

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: Advice on cleaning up a Word document

Post by Rudi »

Actually that gives me an idea. If one has a blank template on which the original "mutated" document was based, one can paste as text into the template and reassign the already setup styles to the paragraphs as you work your way from top to bottom. Good strategy.
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

User avatar
DaveA
GoldLounger
Posts: 2599
Joined: 24 Jan 2010, 15:26
Location: Olympia, WA

Re: Advice on cleaning up a Word document

Post by DaveA »

I would go with Hans' method any time.
I am so far behind, I think I am First :evilgrin:
Genealogy....confusing the dead and annoying the living

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: Advice on cleaning up a Word document

Post by Rudi »

HansV wrote: Create only the strictly necessary styles in the new document.
On a similar note:
Does anyone have a macro that can quickly delete ALL the styles EXCEPT ones that are actually in use in a given document.
I have seen one or two on the web, but they looked extremely bloated and cumbersome.

Not urgent, just inquiring... TX
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

User avatar
HansV
Administrator
Posts: 78457
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Advice on cleaning up a Word document

Post by HansV »

Go with one of the bloated, cumbersome macros. Simple ones won't do what you want.
Best wishes,
Hans

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: Advice on cleaning up a Word document

Post by Rudi »

HansV wrote:Go with one of the bloated, cumbersome macros. Simple ones won't do what you want.
:laugh: I should put that statement in the Proverbial Contradictions Thread.... :grin:
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15611
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Advice on cleaning up a Word document

Post by ChrisGreaves »

Rudi wrote:Can I get some thoughts and ideas...
http://www.chrisgreaves.com/DocumentConversion/
P.S. Want to see my Styles suite?
You do not have the required permissions to view the files attached to this post.
There's nothing heavier than an empty water bottle

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: Advice on cleaning up a Word document

Post by Rudi »

Hey Chris,

is there any chance that I can borrow a spanner from that rather large toolset... :smile:
Last edited by Rudi on 20 Jun 2014, 11:38, edited 2 times in total.
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

User avatar
macropod
4StarLounger
Posts: 508
Joined: 17 Dec 2010, 03:14

Re: Advice on cleaning up a Word document

Post by macropod »

A simpler cleanup method might be to copy & paste - with formatting, then use Ctrl-A, Ctrl-Spacebar in the copied document. That should remove all direct formatting, leaving you with much less to clean up. Find/Replace can also be used to exchange unwanted Styles with the correct ones prior to the unwanted Styles' deletion.

Except for Linked and BuiltIn Styles, the following macro deletes all unused Styles in a document.

Code: Select all

Sub DeleteUnusedStyles()
Dim Doc As Document, bDel As Boolean
Dim Rng As Range, StlNm As String, i As Long
Application.ScreenUpdating = False
Set Doc = ActiveDocument
With Doc
  For i = .Styles.Count To 1 Step -1
    With .Styles(i)
      If .BuiltIn = False And .Linked = False Then
        bDel = True: StlNm = .NameLocal
        For Each Rng In Doc.StoryRanges
          With Rng
            With .Find
              .ClearFormatting
              .Format = True
              .Style = StlNm
              .Execute
            End With
            If .Find.Found = True Then
              bDel = False
              Exit For
            End If
          End With
        Next
        If bDel = True Then .Delete
      End If
    End With
  Next
End With
Application.ScreenUpdating = True
End Sub
Paul Edstein
[Fmr MS MVP - Word]

User avatar
Jay Freedman
Microsoft MVP
Posts: 1318
Joined: 24 May 2013, 15:33
Location: Warminster, PA

Re: Advice on cleaning up a Word document

Post by Jay Freedman »

mess of "sub" styles where it lists Heading 1 + Bold+ Line Spacing, etc...
The Ctrl+A, Ctrl+spacebar to clear direct formatting will get rid of those. Even without it, though, you can suppress their display as styles. Press Ctrl+Alt+Shift+S to open the Styles pane, and click the Options link at the bottom of the pane. In the Options dialog, under "Select formatting to show as styles", uncheck all three boxes.

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: Advice on cleaning up a Word document

Post by Rudi »

Oh...the VALUE of a forum...
These are awesome contributions! My TX to everyone that has replied. Certainly some food for thought and I have a lot of testing to do with the given advice.
Grateful :cheers:
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: Advice on cleaning up a Word document

Post by Rudi »

Hi Chris,

I'm running Office 2013 32bit.
It seems your Add-In is not compatible with this version. :sad:
I am however very grateful for your willingness to assist and share this Add-In of yours.

Cheers
1.jpg
2.jpg
You do not have the required permissions to view the files attached to this post.
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15611
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Advice on cleaning up a Word document

Post by ChrisGreaves »

Rudi wrote:Hi Chris,I'm running Office 2013 32bit. It seems your Add-In is not compatible with this version.
Hi Rudi. Sad news indeed.
I will rustle up (if I can) a copy of 2013 and see what happens on my 64-bit.
I'm unlikely to find a 32-bit m/c nowadays.
Cheers
There's nothing heavier than an empty water bottle

User avatar
StuartR
Administrator
Posts: 12604
Joined: 16 Jan 2010, 15:49
Location: London, Europe

Re: Advice on cleaning up a Word document

Post by StuartR »

Chris,

Do you really run a 64 bit version of Office? That's quite unusual. Most of us run 32 bit Office with 64 bit Windows - because so many things are incompatible with 64 bit Office.
StuartR