Open drmacro opened 3 months ago
This appears to be a bit more complicated than I had thought.
There is clearly a particular combination of elements with an ToC paragraph that Word recognizes as a ToC entry with a page reference such that when you say "update field" on the ToC it gives you the option of updating just the page numbers and not the ToC entries themselves.
It looks like it might be that the entire content of the paragraph must be within a single hyperlink but still experimenting with that.
As far as I can tell, the only variable is the styles for the target paragraphs: When they are ToC-generating styles, then you get the option to update just the page numbers. When they are not, you do not.
Have updated the code so it only sets dirty="on" when there are no child
This means that if you want the ToC to be autogenerated, do not include any literal
Does this update to the behavior of the "dirty" setting satisfy the requirement?
When a element specifies bookmarkRef, the attribute is ignored and no page number reference is generated.
In addition, the dirty="yes" setting should not be set when there are explicit ToC entries as Word will overwrite them if you respond "yes" to the open-time prompt to update fields.