Hi,
I'm following the tutorial to add a table of contents to my document, but when I call document.UpdateTableOfContents(), it gets updated but loses all formatting. Am I missing something?
var partoc = section.AddParagraph();
partoc.ParagraphFormat.SpaceAfterAuto = true;
Style stylep = (WParagraphStyle)document.AddParagraphStyle("TOCStyle");
stylep.CharacterFormat.Bold = true;
stylep.CharacterFormat.FontName = "Helvetica";
stylep.CharacterFormat.FontSize = 10;
TableOfContent toc = partoc.AppendTOC(1, 3);
toc.UseHeadingStyles = true;
toc.IncludePageNumbers = true;
toc.RightAlignPageNumbers = true;
toc.UseHyperlinks = true;
toc.SetTOCLevelStyle(1, "TOCStyle");
toc.SetTOCLevelStyle(2, "TOCStyle");
partoc.ApplyStyle("TOCStyle");
document.UpdateTableOfContents()