Novacode.DocX.InsertTableOfContents C# (CSharp) Method

InsertTableOfContents() public method

Inserts at TOC into the current document before the provided reference
public InsertTableOfContents ( Paragraph reference, string title, TableOfContentsSwitches switches, string headerStyle = null, int maxIncludeLevel = 3, int rightTabPos = null ) : Novacode.TableOfContents
reference Paragraph The paragraph to use as reference
title string The title of the TOC
switches TableOfContentsSwitches Switches to be applied, see: http://officeopenxml.com/WPtableOfContents.php
headerStyle string Lets you set the style name of the TOC header
maxIncludeLevel int Lets you specify how many header levels should be included - default is 1-3
rightTabPos int Lets you override the right tab position - this is not common
return Novacode.TableOfContents
        public TableOfContents InsertTableOfContents(Paragraph reference, string title, TableOfContentsSwitches switches, string headerStyle = null, int maxIncludeLevel = 3, int? rightTabPos = null)
        {
            var toc = TableOfContents.CreateTableOfContents(this, title, switches, headerStyle, maxIncludeLevel, rightTabPos);
            reference.Xml.AddBeforeSelf(toc.Xml);
            return toc;
        }

Same methods

DocX::InsertTableOfContents ( string title, TableOfContentsSwitches switches, string headerStyle = null, int maxIncludeLevel = 3, int rightTabPos = null ) : Novacode.TableOfContents