A family of Microsoft word processing software products for creating web, email, and print documents.
Did you remember to add the TOC styles to the list of allowed styles?
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have created a .dotm (the macro runs a form for some project info to insert in the document) and in this template I have inserted a TOC.
I have formatted the TOC1, 2 and 3 to the style I want it to have and it really looks nice. I then protect the document for style editing, allowing only for predefined styles.
Now; I save the template and load a document from the template to start. In this document I enter some text, apply the various styles including headings in levels 1-3. Then I right-click the TOC and opt for [Update entire table] and the TOC is updated. Information in the TOc is correct but the formatting is all off: It defaults to style [Normal].
Why does this happen? I have defined (modified) the TOC-styles levels 1-3 through the dialog box (Right-click TOC>Edit table>etc...) and when I try it out - in the template, that is the .dotm - with text, ti comes out nice and right. But when I generate a document from the template and update TOC in this, it defaults to [Normal] and looks like *#¤%...
And suggestions are welcome.
Best regards,
Ulf
A family of Microsoft word processing software products for creating web, email, and print documents.
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
Did you remember to add the TOC styles to the list of allowed styles?
If you customized your TOC styles, I would also remove the 'auto update'. I've only had bad experiences with that option.
I took a look at a couple of the TOC styles in my NORMAL. They are also based on the NORMAL style, with only indenting added.
To try and get control of your TOC styles I'd suggest (in a new "junk" doc file):
Dear Stefan and Rohn007,
Thank you for your responses.
Stefan, as you note; direct formatting is not used. Every heading and other formatting is applied with styles I defined. These styles are all built on the corresponding bulit-in style e.g. MyHeader1 built on Heading 1, MyHeader2 built on Heading 2 and so on.
Rohn007, You text does make sense but I have not tweaked any formatting to my headings with any direct formatting. Unfortunately.
When defining my template I inserted the TOC and modified the TOC-level styles through the said right-click procedure. Note - and this may be a clue to the problem - that I redefined the built-in TOC-styles retaining the [Automatically update]-attribute.
When the document based on the template is generated and the TOC is updated to the wrong format, I can (as I am the manager of the document and remove/apply the protection) check the built-in TOC-level styles and they all are formatted as I defined. Nevertheless, the TOC when updated, is defaulting to [Normal].
One more clue - perhaps - is that the TOC looks ok when I opt to only update page numbers.
Additionally: At first, my [Normal] was Times new roman and this was then the font in my updated TOC. When I modified [Normal] to Arial font type, this was the one in the TOC. So, somewhere, it may have to do with the fact that TOC-level styles are built on [Normal] style. I ahev also tried to define some costum TOC-level styles from the built-ins, but this did not work either.
Thanks for the suggestions.
Best regards,
Ulf
Ulf, how are you applying the heading styles.
Extending what Stefan said, if you applied a heading style 1, if you manually apply bold to the heading to 'tweak it', when it is migrated into the TOC, the manual BOLD attribute affects how the TOC style is displayed. Does that make sense?
Try selecting one of the affected headings and using <CTL Spacebar> to clear all manual formatting. Then click on the TOC and press <F9> to refresh it. Does that fix the problem?
The only explanation that comes to mind is that direct font formatting applied to headings will reflect in the TOC entries. On the other hand, since you are working with a protected document, applying direct formatting shouldn’t be an option.