How to fix the document map in MS Word 2007

The Document Map! That horrendous, horrible, horrific horror! It never does what I ask it to, it never shows what I tell it to show, it constantly messes itself up beyond recognition. It’s like a crazy guy beating himself up, I keep thinking of Fight Club. The first rule of Document Map is you don’t talk about Document Map. And yet, I am going to talk about it.

Today I suddenly found out the magic trick, the silver bullet that fixes the problem that had haunted me for so long.

As any professional MS Word user, I use the map extensively, even though its quirks pester me constantly. It’s just too powerful to let go.

What are its problems?

  1. Outline works, as long as you have very strict usage of headings. A lot of documents fail this, especially if they aren’t created by yours truly (ahem).
  2. Titles show no outline numbering, even though it’s definitely there. This is more an annoyance then an outright problem.
  3. The map is not updated. Grrrrr.

It appears Microsoft has put some fuzzy logic in the document map. Now most of the time I don’t really care about MS’s guess at what I want to do. If I press TAB then most of the time I actually want an indent. If I type ‘Teh’ I do mean ‘The’. And of course, I know how to disable that behavior.

However, the document map seems to magically create non-existing headings from my text, and not in the farthest corners of options and settings is there mentioning of the document map doing this. It’s like an easter egg, but not a very funny one.

And then I did what I often do when cleaning up documents. I pressed “CTRL+Q+SPACE”. If you don’t know this trick, it’s the ultimate cleanup action. It removes all and every formatting. I had the map open because I was about to do some things with headings when I noticed after pressing ‘CTRL+Q’ that the item disappeared from the map, as it should because it wasn’t a heading! Then, by not continuing with CTRL+SPACE I retained the original formatting (bold in this case).

Before you select all text and press CTRL+SPACE remember it wil turn lists into regular paragraphs, so make sure to just do this on the items that need to be removed from the map. If that still doesn’t work continue to press CTRL+SPACE. You will lose formatting, which you should recreate using styles. And if that fails make sure to press the Normal style button to revert to the default formatting.

The second problem appeared to actually be a bug. A heading right after a page break will not show its numbering. Well, that’s minor and you can always select ‘page break before’ in the style settings.

The third was related to both 1 and 2, perhaps it won’t happen again. I hope so, I really do.

Try it out and let me know of any other problems you encounter with the document map.

Update: someone created a macro for fixing the document map!

Here’s the slightly modified code for this (I added a progress counter):

Sub ResetOutline()
    Dim currentParagraph As Paragraph
    Dim numParagraphs As Long
    Dim percentComplete As Byte
    Dim oldPercentage As Byte
    Dim n As Long
    
    numParagraphs = ActiveDocument.Paragraphs.Count
    n = 0
    For Each currentParagraph In ActiveDocument.Paragraphs
        percentComplete = Round(n / numParagraphs * 100, 0)
        If percentComplete > oldPercentage Then
            Debug.Print percentComplete & "%"
            Application.StatusBar = "Processing... " & percentComplete & "% complete"
            DoEvents
        End If
        n = n + 1
        currentParagraph.OutlineLevel = currentParagraph.Style.ParagraphFormat.OutlineLevel
        oldPercentage = percentComplete
    Next currentParagraph
    Application.StatusBar = ""
End Sub
Advertisements

11 comments so far

  1. You are my hero.

  2. Pania on

    You’re a legend!!! You just saved me from re-doing all the headings in my document ….which is 2000 pages long!! Thank you sooooo much!!!

  3. Rex on

    you just saved me

  4. Guru on

    Thanks a ton. And..Your comments were funny too. I had a good laugh, that released all that tension I had trying to fix that Document Map mess!

    • michiel on

      Well, thank you too there!

  5. David on

    when you refresh the TOC, save, and re-open the file…seems as nothing has been changed…

  6. Sims on

    Wow, such a quick and reliable fix. It worked for me and thanks for putting up this tip here. Thank you so much. 🙂

  7. Mark Nazimova on

    Ctrl + Q. Wow. Thank you, thank you, thank you!

    In my case, this bug affected not only Word’s Document Map, but also Acrobat’s Bookmarks panel when I generated a PDF from the corrupted Word file. Once I remove the errant underlying formatting via Ctrl + Q it cleans up not only the Document Map, but also the Bookmarks panel in Acrobat when I regenerate the PDF.

    I miss the first tab of the Navigation pane in later versions of Word. So much better than the 2007’s Document Map. I hope my current company upgrades soon.

    Again: thank you, thank you, thank you!

  8. Wayne on

    Ugh! Clearing the formatting gets rid of the 100,000 unwanted entries in the Doc Map until I save and reopen and then when I reopen the doc they all appear again. The macro doesn’t work either.

    Help! I’m losing my mind.

    • Mark Nazimova on

      Have you hidden the doc map panel before you save and reopen?

    • michiel on

      It could be macros are disabled on your system. Go into Office Button > Word Options > Trust Center > Trust Center Settings > Disable all macros with notification
      Then restart Word and open your document. Do ALT+F11 and add the macro to a module and run it.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: