Hi
Its possible auto generate TOC in word document like this....
WebKitConverterSettings settings = new WebKitConverterSettings();
settings.EnableBookmarks = true;
settings.EnableToc = true;
settings.Toc.Title = "Tabla de Contenido";
I like to know if same same simplicity exists for HTML to WORD conversion?
Thanks in advance
|
WordDocument document = new WordDocument(inputFileName); //Adds the paragraph into the created section WParagraph paragraph = new WParagraph(document); document.Sections[0].Body.ChildEntities.Insert(0, paragraph); //Appends the TOC field with LowerHeadingLevel and UpperHeadingLevel to determines the TOC entries paragraph.AppendTOC(1, 3); //Updates the table of contents document.UpdateTableOfContents(); document.Save("Output.docx", FormatType.Docx); document.Close(); |
Hi Manikandan Ravichandran
I cannot run your code snippet because I get error with
this line
document.UpdateTableOfContents(); <---- this method not exists!
I have Syncfusion.DocIO.Net.Core version 19.4.0.4
Thanks Manikandan
Works fine!