Hi,
I want to change the table of contents of the “AsposeDoc.docx” document for the result “FinalDoc.docx” document.
Should I change the hyperlinks in the table of contents?
How do I get the following result:
TOC:
HEADING PAGE…1
Table of contents…1
Front Cover…1
CHAPTER 0 : INTRODUCTION…2
Introduction…2
Result:
HEADING PAGE…HDG
Table of contents…HDG
Front Cover…HDG
CHAPTER 0 : INTRODUCTION…CHAP0
Introduction…CHAP0
Source code of the “TOC” insertion:
DocumentBuilder builder = new DocumentBuilder(document);
builder.writeln();
Field tocField = builder.insertTableOfContents("\o “1-” + printOptions.get(DO_OPTION_TOCLEVEL) + “” \h \z \u");
tocField.update();
I look forward to your response.
Best Regards,
Patrice ANTOINE