Hi
Thanks for your inquiry. I managed to reproduce the problem on my side. Your request has been linked to the appropriate issue. You will be notified as soon as it is resolved. As a workaround, you can try using the following code:
DocumentBuilder builder = new DocumentBuilder();
// Get the document used by the DocumentBuilder.
Document doc = builder.Document;
List headlineList = doc.Lists.Add(ListTemplate.OutlineHeadingsLegal);
// WORKAROUND: Problem with text position occurs because there are tabs.
// To work the problem around we can specify a whitespace as traling character.
foreach (ListLevel level in headlineList.ListLevels)
level.TrailingCharacter = ListTrailingCharacter.Space;
// Insrt a table of contents at the beginning of the document.
builder.InsertTableOfContents("\\o \"1-3\" \\h \\z \\u");
// Build a document with complex structure by applying different heading styles thus creating TOC entries.
builder.InsertBreak(BreakType.ParagraphBreak);
builder.ParagraphFormat.ClearFormatting();
builder.ParagraphFormat.StyleIdentifier = StyleIdentifier.Heading1;
builder.ListFormat.List = headlineList;
builder.ListFormat.ListLevelNumber = 0;
builder.Writeln("Heading 1");
builder.ParagraphFormat.ClearFormatting();
builder.ParagraphFormat.StyleIdentifier = StyleIdentifier.Heading2;
builder.ListFormat.List = headlineList;
builder.ListFormat.ListLevelNumber = 1;
builder.Writeln("Heading 1.1");
builder.Writeln("Heading 1.2");
builder.ParagraphFormat.ClearFormatting();
builder.ParagraphFormat.StyleIdentifier = StyleIdentifier.Heading1;
builder.ListFormat.List = headlineList;
builder.ListFormat.ListLevelNumber = 0;
builder.Writeln("Heading 2");
builder.Writeln("Heading 3");
builder.ParagraphFormat.ClearFormatting();
builder.ParagraphFormat.StyleIdentifier = StyleIdentifier.Heading2;
builder.ListFormat.List = headlineList;
builder.ListFormat.ListLevelNumber = 1;
builder.Writeln("Heading 3.1");
builder.ParagraphFormat.ClearFormatting();
builder.ParagraphFormat.StyleIdentifier = StyleIdentifier.Heading3;
builder.ListFormat.List = headlineList;
builder.ListFormat.ListLevelNumber = 2;
builder.Writeln("Heading 3.1.1");
builder.Writeln("Heading 3.1.2");
builder.Writeln("Heading 3.1.3");
builder.ParagraphFormat.StyleIdentifier = StyleIdentifier.Heading2;
builder.Writeln("Heading 3.2");
builder.Writeln("Heading 3.3");
doc.UpdateFields();
doc.UpdatePageLayout();
doc.Save(@"Test001\out.doc");