Inserttoc

is there a way to indent the toc to middle of page?

@nightcoder The answer depends on how exactly you added the table of content. Please, attach the document and we will provide you with more information.

this is how we are creating the toc;
builder.ParagraphFormat.LeftIndent = 200;
builder.InsertTableOfContents("\o “1-2” \h \z \u \w ");
Doc.UpdateFields();

the leftIndent does nothing to help.

@nightcoder please consider the following code

...
doc.UpdateFields();
foreach (Style style in doc.Styles)
{
    if (style.StyleIdentifier == StyleIdentifier.Toc1 ||
        style.StyleIdentifier == StyleIdentifier.Toc2 ||
        style.StyleIdentifier == StyleIdentifier.Toc3)
        style.ParagraphFormat.LeftIndent = 200;
}
1 Like