I use the net 40 version 12.2.0 freespire.doc
When creating the TOC Table of Contents, I faced the problem that it is impossible to determine the font of the table of contents.
Please tell me how to do this?
I need to set the font size = 14, and the font Name is "Times New Roman".
By default, a style is used that is not present in the document style collection.
And I don't understand how it can be redefined.
Thanks in advance to the technical support for the response.
- Code: Select all
TableOfContent table = new TableOfContent(part_1_footerDocument, "{\\o \"1-9\" \\h \\z \\u}");
paragraphToc.Items.Add(table);
// not work
table.CharacterFormat.FontName = "Times New Roman";
table.CharacterFormat.FontSize = 14;
//
paragraphToc.AppendFieldMark(FieldMarkType.FieldSeparator);
paragraphToc.AppendText("TOC");
paragraphToc.AppendFieldMark(FieldMarkType.FieldEnd);
part_1_footerDocument.TOC = table;
// down now this not work
part_1_footerDocument.UpdateTableOfContents(table);
TableOfContent tableOfContent = part_1_footerDocument.TOC;
tableOfContent.CharacterFormat.FontSize = 14;
tableOfContent.CharacterFormat.FontName = "Times New Roman";
part_1_footerDocument.UpdateTableOfContents(tableOfContent );
