Skip to content

Commit aa9ba70

Browse files
committed
Added changes
1 parent 1ada2e2 commit aa9ba70

2 files changed

Lines changed: 1 addition & 2 deletions

File tree

‎Table-Of-Contents/Add-TOC-with-headings-TC-Fields/.NET/Add-TOC-with-headings-TC-Fields/Program.cs‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
#region InsertTOCEntryField
2323
//Access exisiting paragraph
24-
paragraph = (WParagraph)(document.Sections[0].Tables[1].Rows[0].Cells[1].ChildEntities[0] as WTable).Rows[0].Cells[0].ChildEntities[0];
24+
paragraph = (WParagraph)(document.Sections[0].Tables[0].Rows[0].Cells[1].ChildEntities[0] as WTable).Rows[0].Cells[0].ChildEntities[0];
2525
//Append field of type TOCEntry
2626
WField field = (WField)paragraph.AppendField(paragraph.Text, FieldType.FieldTOCEntry);
2727
#endregion
@@ -30,7 +30,6 @@
3030
paragraph = (WParagraph)(document.Sections[0].Tables[1].Rows[0].Cells[1].ChildEntities[0] as WTable).Rows[1].Cells[0].ChildEntities[0];
3131
//Apply "Heading 1" style for paragraph
3232
paragraph.ApplyStyle(BuiltinStyle.Heading1);
33-
//paragraph.ApplyStyle(BuiltinStyle.Heading2);
3433
#endregion
3534

3635
//Update Table of contents

0 commit comments

Comments
 (0)