A family of Microsoft word processing software products for creating web, email, and print documents.
Hello,
Does anyone have a suggestion regarding my last request?
thanks in advance
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
In the attached document.xml file extracted from my .docx file, the "dirty = true" attribute displays the toc well but does not update the page numbers.
could someone tell me where the problem may be coming from?
Thanks in advance.
Best regards118343-document.xml
A family of Microsoft word processing software products for creating web, email, and print documents.
Hello,
Does anyone have a suggestion regarding my last request?
thanks in advance
Yes, I found this article (http://www.ericwhite.com/blog/screen-cast-exploring-tables-of-contents-in-open-xml-wordprocessingml-documents/) as well as the others and I have tested the "dirty = true" attribute in the document.xml file and the "updateFields" element in the settings.xml file because this solution is integrated in the docx file and it is the only solution that we can set up with our client. These two solutions do an update of the translation table but not of the page numbers in this translation table. On the other hand they do not seem to do the same thing as the following VB instructions which correctly update the table and the page numbers:
ActiveDocument.TablesOfContents (1) .Update
I'd like to know why this doesn't work with "dirty" or "updateFields" and if not, is there some other way (other open xml element or attribute) to properly update the translation table and page numbers?
Thanks in advance.
So I have to ask my questions on the forum that you indicated to me rather than on the one where we are currently discussing?
But of course I left the attribute "dirty = true" in the document.xml file:
<w:r>
<w:fldChar w:fldCharType="begin" w:dirty="true"/>
</w:r>
<w:r>
<w:instrText>TOC \t "H1;1;H2;2;H3;3" \b _Section100000</w:instrText>
</w:r>
<w:r w:rsidR="776cd4">
<w:rPr>
<w:noProof/>
</w:rPr>
<w:fldChar w:fldCharType="end"/>
</w:r>
I found this on a forum and embedded it in the document.xml file I sent you:
https://social.msdn.microsoft.com/Forums/en-US/29199b44-f033-466a-a471-6bdcfeb47e41/generating-table-of-contents-and-applying-a-custom-style?forum=oxmlsdk
"Creating a table of contents requires some kind of layout engine in order to determine page numbers. As you may know, the Open XML SDK does not perform layout functionality. That being said, there is a way around this limitation. You can let Word update the TOC on open by doing the following to the markup:
1-Set the dirty attribute to have a value of true within the fldChar element
2-Set the upateFileds element in Settings.xml to be true"
I had also integrated the "upateFileds" element in the Settings.xml file but it didn't change anything so I removed it