DocX icon indicating copy to clipboard operation
DocX copied to clipboard

Empty Table of content (TOC)

Open Pelu2k12 opened this issue 7 years ago • 4 comments

Hello, I'm trying to generate a table of content, but the resulting document doesn't display any items in the TOC. I'm using your example code (DocX/Examples/Samples/TableOfContent/TableOfContentSample.cs) for the TOC without any modifications.

image

Pelu2k12 avatar Nov 27 '18 16:11 Pelu2k12

Hi,

When you open the resulting document with MS Word, you should see a popup asking if you want to update the document fields. Saying yes will update the TOC.

XceedBoucherS avatar Jan 11 '19 12:01 XceedBoucherS

@Pelu2k12 You may need to look at the fix I did in ticket 300 for the TOC to be indented.

Issue #300

Wayne-Mather avatar Mar 12 '19 10:03 Wayne-Mather

@XceedBoucherS is this the only way to generate a TOC? In a web app scenario the popupp is undesirable and the message that word presents say's nothing aboout updating the TOC. It only scares the users into clicking NO.

wis3guy avatar Nov 28 '19 11:11 wis3guy

@wis3guy yes, for now this is the way to create a TOC. What this "DocX" does is update the ooxml from the docx document. When MS Word opens this modified docx, he will ask to update the TOC. Saying yes will force MS Word to update its fields (which the TOC is) and display the TOC adequately.

XceedBoucherS avatar Dec 03 '19 12:12 XceedBoucherS