# MS Word Style Headings changes when reopening doc



## kchoo (Dec 29, 2009)

*MS Word 2007 Style Headings changes when reopening doc*

MS Office Professional 2007 with SP2
Windows XP

My friend created a word document in Office 2007 and set Heading styles to certain text, i.e. level 1, level 2 to organize the doc and using document map to view the levels. Whenever a table of contents is inserted, and the document is closed and reopened, in the bottom bar of the ms word window, sometimes it quickly flashes 'MS is formatting the document', then all the Heading styles get messed up. Body text turns into Level headings, etc. and the organization has gone mucho loco. 

We've tried turning off all auto update options including those related to 'styles' in advanced options with the same result. Excluding the table of contents keeps it from messing up. Something possibly with the table of contents that it does not like. Fixing the heading styles, saving then reopening the doc messes it up every time. Anyone else seen this? I am not going crazy. Possible bug with Word 2007? Confirmed and reproduced the problem on multiple computers.


----------



## macropod (Apr 11, 2008)

Hi kchoo,

It may be that the document is corrupt. Ordinarily, the only reason a document's Style definitions might change when opening the document is if it has the 'Automatically update document Styles' option activated. That has nothing to do with TOCs, though.

Something else that can cause problems when inserting a TOC is inserting the TOC into a paragraph that's formatted with one of the Heading Styles, especially if the Heading Styles have the 'automatically update' option checked.


----------



## kchoo (Dec 29, 2009)

Thank you macropod for your generous help. I suspected it may be corrupt so I copied the content, cleared all formatting and copied into a new document. Then I set multiple style levels, inserted a new automatic table of contents. Saved, closed and reopened to find it messed up again. But I am able to create a file where it works fine as well with some styles set with a toc inserted. That's whats confusing. Nothing crazy with the text in the failing doc. Lots of bullet points, about 80+ pages. The toc is not inserted into an area that has any heading styles. Maybe related to the size of the doc?


----------



## macropod (Apr 11, 2008)

Hi kchoo,

I doubt the file size is an issue - Word can handle files of up to 512Mb, containing 32Mb (or more) of text.

What was the paragraph Style immediately following the insertion point where you added the TOC? Are you modifying the TOC Styles in any way? Do any of the Heading Styles have the 'automatically update' option checked? (Note: ISTR this is especially hard to check for Heading1 in Word 2007 and can only be done/changed with vba).


----------



## kchoo (Dec 29, 2009)

Hi macropod, I agree file size doesn't seem to be it. The Paragraph style after the TOC point is default - single line spacing, 0 pt before and after, body text level. Heading styles do not have the 'auto update' checked. TOC styles are not being modified.

If you would like I can email you the file in question.Not sure if it will have same issue if not using 2007. To reproduce problem: Open in 2007. Demote the first 12 lines on the left document map to body text starting with Care Group Orientation. First remaining point should be 'Lesson 1: Intro to Care Groups'. Once demoted, save document. Close and reopen. The text you demoted will appear as heading levels once again. Demoting a few lines at a time will keep it for a while but eventually messes up as well.


----------



## kchoo (Dec 29, 2009)

I hope someone can offer some help.

My colleague who has been battling this problem for months, found that if they hold down the 'esc' key as the word document opens, it prevents the chaotic style heading changes. All auto correct options are disabled in options. I'd like to find the underlying problem and how to fix it. These documents are curricula that we share with health professionals in Africa to prevent malnutrition deaths in children. Very very important. Thanks.


----------



## kchoo (Dec 29, 2009)

update. amazing. resetting the registry key solved it.


----------



## macropod (Apr 11, 2008)

Hi kchoo,

Evidently there was a bug with the Office installation. What was the process you used for re-setting the registry key? That info might be useful for anyone else who runs into the same problem.

As an aside, had you tried repairing the Office installation beforehand, via Word Options|Resources|Diagnose?


----------



## kchoo (Dec 29, 2009)

Spoke too soon. Problem is back. I think its the file not the install. Problem reproduces on other machines as well.

Resetting the registry keys below allows the file to open once without messing up but then it comes back quickly.

http://support.microsoft.com/kb/921541


----------



## macropod (Apr 11, 2008)

Hi Kevin,

I've re-checked and still can't see anything out of the ordinary in your Word file.

As per my last post, though, have you tried repairing the Office installation, via Word Options|Resources|Diagnose?


----------



## kchoo (Dec 29, 2009)

Greetings again.

Yes, we've tried repair and even re installing entirely. The problem also occurs on more than one machine. We're looking into add ins and templates but nothing solid yet. Frustrating..


----------



## macropod (Apr 11, 2008)

Hi Kevin,

Did the document originate in a pre-2007 version of Word? If so, it may have carried over some corruption from the previous version. For ealier versions, a simple and generally effective fix was to insert a new last para, then copy all except the new last para to another document. I don't know whether this works with docx files, but it's worth trying - especially if you work on a doc-format version of the document.


----------

