Style |
Member name | Value | Description |
---|---|---|
DefaultParagraphFont | 0 | 'DefaultParagraphFont' CharacterStyle. |
Strong | 1 | 'Strong' CharacterStyle. |
Emphasis | 2 | 'Emphasis' CharacterStyle. |
SubtleEmphasis | 3 | 'SubtleEmphasis' CharacterStyle. |
IntenseEmphasis | 4 | 'IntenseEmphasis' CharacterStyle. |
SubtleReference | 5 | 'SubtleReference' CharacterStyle. |
IntenseReference | 6 | 'IntenseReference' CharacterStyle. |
BookTitle | 7 | 'BookTitle' CharacterStyle. |
Hyperlink | 8 | 'Hyperlink' CharacterStyle. |
Normal | 9 | 'Normal' ParagraphStyle. |
Heading1 | 10 | 'Heading 1' ParagraphStyle. |
Heading2 | 11 | 'Heading 2' ParagraphStyle. |
Heading3 | 12 | 'Heading 3' ParagraphStyle. |
Heading4 | 13 | 'Heading 4' ParagraphStyle. |
Heading5 | 14 | 'Heading 5' ParagraphStyle. |
Heading6 | 15 | 'Heading 6' ParagraphStyle. |
Heading7 | 16 | 'Heading 7' ParagraphStyle. |
Heading8 | 17 | 'Heading 8' ParagraphStyle. |
Heading9 | 18 | 'Heading 9' ParagraphStyle. |
Title | 19 | 'Title' ParagraphStyle. |
Subtitle | 20 | 'Subtitle' ParagraphStyle. |
NoSpacing | 21 | 'NoSpacing' ParagraphStyle. |
Quote | 22 | 'Quote' ParagraphStyle. |
IntenseQuote | 23 | 'IntenseQuote' ParagraphStyle. |
ListParagraph | 24 | 'ListParagraph' ParagraphStyle. |
TableNormal | 25 | 'Normal Table' TableStyle (MS WORD 2010). |
TableGrid | 26 | 'Table Grid' TableStyle (MS WORD 2010). |
LightShading | 27 | 'Light Shading' TableStyle (MS WORD 2010). |
LightShadingAccent1 | 28 | 'Light Shading Accent 1' TableStyle (MS WORD 2010). |
LightShadingAccent2 | 29 | 'Light Shading Accent 2' TableStyle (MS WORD 2010). |
LightShadingAccent3 | 30 | 'Light Shading Accent 3' TableStyle (MS WORD 2010). |
LightShadingAccent4 | 31 | 'Light Shading Accent 4' TableStyle (MS WORD 2010). |
LightShadingAccent5 | 32 | 'Light Shading Accent 5' TableStyle (MS WORD 2010). |
LightShadingAccent6 | 33 | 'Light Shading Accent 6' TableStyle (MS WORD 2010). |
LightList | 34 | 'Light List' TableStyle (MS WORD 2010). |
LightListAccent1 | 35 | 'Light List Accent 1' TableStyle (MS WORD 2010). |
LightListAccent2 | 36 | 'Light List Accent 2' TableStyle (MS WORD 2010). |
LightListAccent3 | 37 | 'Light List Accent 3' TableStyle (MS WORD 2010). |
LightListAccent4 | 38 | 'Light List Accent 4' TableStyle (MS WORD 2010). |
LightListAccent5 | 39 | 'Light List Accent 5' TableStyle (MS WORD 2010). |
LightListAccent6 | 40 | 'Light List Accent 6' TableStyle (MS WORD 2010). |
LightGrid | 41 | 'Light Grid' TableStyle (MS WORD 2010). |
LightGridAccent1 | 42 | 'Light Grid Accent 1' TableStyle (MS WORD 2010). |
LightGridAccent2 | 43 | 'Light Grid Accent 2' TableStyle (MS WORD 2010). |
LightGridAccent3 | 44 | 'Light Grid Accent 3' TableStyle (MS WORD 2010). |
LightGridAccent4 | 45 | 'Light Grid Accent 4' TableStyle (MS WORD 2010). |
LightGridAccent5 | 46 | 'Light Grid Accent 5' TableStyle (MS WORD 2010). |
LightGridAccent6 | 47 | 'Light Grid Accent 6' TableStyle (MS WORD 2010). |
MediumShading1 | 48 | 'Medium Shading 1' TableStyle (MS WORD 2010). |
MediumShading1Accent1 | 49 | 'Medium Shading 1 Accent 1' TableStyle (MS WORD 2010). |
MediumShading1Accent2 | 50 | 'Medium Shading 1 Accent 2' TableStyle (MS WORD 2010). |
MediumShading1Accent3 | 51 | 'Medium Shading 1 Accent 3' TableStyle (MS WORD 2010). |
MediumShading1Accent4 | 52 | 'Medium Shading 1 Accent 4' TableStyle (MS WORD 2010). |
MediumShading1Accent5 | 53 | 'Medium Shading 1 Accent 5' TableStyle (MS WORD 2010). |
MediumShading1Accent6 | 54 | 'Medium Shading 1 Accent 6' TableStyle (MS WORD 2010). |
MediumShading2 | 55 | 'Medium Shading 2' TableStyle (MS WORD 2010). |
MediumShading2Accent1 | 56 | 'Medium Shading 2 Accent 1' TableStyle (MS WORD 2010). |
MediumShading2Accent2 | 57 | 'Medium Shading 2 Accent 2' TableStyle (MS WORD 2010). |
MediumShading2Accent3 | 58 | 'Medium Shading 2 Accent 3' TableStyle (MS WORD 2010). |
MediumShading2Accent4 | 59 | 'Medium Shading 2 Accent 4' TableStyle (MS WORD 2010). |
MediumShading2Accent5 | 60 | 'Medium Shading 2 Accent 5' TableStyle (MS WORD 2010). |
MediumShading2Accent6 | 61 | 'Medium Shading 2 Accent 6' TableStyle (MS WORD 2010). |
MediumList1 | 62 | 'Medium List 1' TableStyle (MS WORD 2010). |
MediumList1Accent1 | 63 | 'Medium List 1 Accent 1' TableStyle (MS WORD 2010). |
MediumList1Accent2 | 64 | 'Medium List 1 Accent 2' TableStyle (MS WORD 2010). |
MediumList1Accent3 | 65 | 'Medium List 1 Accent 3' TableStyle (MS WORD 2010). |
MediumList1Accent4 | 66 | 'Medium List 1 Accent 4' TableStyle (MS WORD 2010). |
MediumList1Accent5 | 67 | 'Medium List 1 Accent 5' TableStyle (MS WORD 2010). |
MediumList1Accent6 | 68 | 'Medium List 1 Accent 6' TableStyle (MS WORD 2010). |
MediumList2 | 69 | 'Medium List 2' TableStyle (MS WORD 2010). |
MediumList2Accent1 | 70 | 'Medium List 2 Accent 1' TableStyle (MS WORD 2010). |
MediumList2Accent2 | 71 | 'Medium List 2 Accent 2' TableStyle (MS WORD 2010). |
MediumList2Accent3 | 72 | 'Medium List 2 Accent 3' TableStyle (MS WORD 2010). |
MediumList2Accent4 | 73 | 'Medium List 2 Accent 4' TableStyle (MS WORD 2010). |
MediumList2Accent5 | 74 | 'Medium List 2 Accent 5' TableStyle (MS WORD 2010). |
MediumList2Accent6 | 75 | 'Medium List 2 Accent 6' TableStyle (MS WORD 2010). |
MediumGrid1 | 76 | 'Medium Grid 1' TableStyle (MS WORD 2010). |
MediumGrid1Accent1 | 77 | 'Medium Grid 1 Accent 1' TableStyle (MS WORD 2010). |
MediumGrid1Accent2 | 78 | 'Medium Grid 1 Accent 2' TableStyle (MS WORD 2010). |
MediumGrid1Accent3 | 79 | 'Medium Grid 1 Accent 3' TableStyle (MS WORD 2010). |
MediumGrid1Accent4 | 80 | 'Medium Grid 1 Accent 4' TableStyle (MS WORD 2010). |
MediumGrid1Accent5 | 81 | 'Medium Grid 1 Accent 5' TableStyle (MS WORD 2010). |
MediumGrid1Accent6 | 82 | 'Medium Grid 1 Accent 6' TableStyle (MS WORD 2010). |
MediumGrid2 | 83 | 'Medium Grid 2' TableStyle (MS WORD 2010). |
MediumGrid2Accent1 | 84 | 'Medium Grid 2 Accent 1' TableStyle (MS WORD 2010). |
MediumGrid2Accent2 | 85 | 'Medium Grid 2 Accent 2' TableStyle (MS WORD 2010). |
MediumGrid2Accent3 | 86 | 'Medium Grid 2 Accent 3' TableStyle (MS WORD 2010). |
MediumGrid2Accent4 | 87 | 'Medium Grid 2 Accent 4' TableStyle (MS WORD 2010). |
MediumGrid2Accent5 | 88 | 'Medium Grid 2 Accent 5' TableStyle (MS WORD 2010). |
MediumGrid2Accent6 | 89 | 'Medium Grid 2 Accent 6' TableStyle (MS WORD 2010). |
MediumGrid3 | 90 | 'Medium Grid 3' TableStyle (MS WORD 2010). |
MediumGrid3Accent1 | 91 | 'Medium Grid 3 Accent 1' TableStyle (MS WORD 2010). |
MediumGrid3Accent2 | 92 | 'Medium Grid 3 Accent 2' TableStyle (MS WORD 2010). |
MediumGrid3Accent3 | 93 | 'Medium Grid 3 Accent 3' TableStyle (MS WORD 2010). |
MediumGrid3Accent4 | 94 | 'Medium Grid 3 Accent 4' TableStyle (MS WORD 2010). |
MediumGrid3Accent5 | 95 | 'Medium Grid 3 Accent 5' TableStyle (MS WORD 2010). |
MediumGrid3Accent6 | 96 | 'Medium Grid 3 Accent 6' TableStyle (MS WORD 2010). |
DarkList | 97 | 'Dark List' TableStyle (MS WORD 2010). |
DarkListAccent1 | 98 | 'Dark List Accent 1' TableStyle (MS WORD 2010). |
DarkListAccent2 | 99 | 'Dark List Accent 2' TableStyle (MS WORD 2010). |
DarkListAccent3 | 100 | 'Dark List Accent 3' TableStyle (MS WORD 2010). |
DarkListAccent4 | 101 | 'Dark List Accent 4' TableStyle (MS WORD 2010). |
DarkListAccent5 | 102 | 'Dark List Accent 5' TableStyle (MS WORD 2010). |
DarkListAccent6 | 103 | 'Dark List Accent 6' TableStyle (MS WORD 2010). |
ColorfulShading | 104 | 'Colorful Shading' TableStyle (MS WORD 2010). |
ColorfulShadingAccent1 | 105 | 'Colorful Shading Accent 1' TableStyle (MS WORD 2010). |
ColorfulShadingAccent2 | 106 | 'Colorful Shading Accent 2' TableStyle (MS WORD 2010). |
ColorfulShadingAccent3 | 107 | 'Colorful Shading Accent 3' TableStyle (MS WORD 2010). |
ColorfulShadingAccent4 | 108 | 'Colorful Shading Accent 4' TableStyle (MS WORD 2010). |
ColorfulShadingAccent5 | 109 | 'Colorful Shading Accent 5' TableStyle (MS WORD 2010). |
ColorfulShadingAccent6 | 110 | 'Colorful Shading Accent 6' TableStyle (MS WORD 2010). |
ColorfulList | 111 | 'Colorful List' TableStyle (MS WORD 2010). |
ColorfulListAccent1 | 112 | 'Colorful List Accent 1' TableStyle (MS WORD 2010). |
ColorfulListAccent2 | 113 | 'Colorful List Accent 2' TableStyle (MS WORD 2010). |
ColorfulListAccent3 | 114 | 'Colorful List Accent 3' TableStyle (MS WORD 2010). |
ColorfulListAccent4 | 115 | 'Colorful List Accent 4' TableStyle (MS WORD 2010). |
ColorfulListAccent5 | 116 | 'Colorful List Accent 5' TableStyle (MS WORD 2010). |
ColorfulListAccent6 | 117 | 'Colorful List Accent 6' TableStyle (MS WORD 2010). |
ColorfulGrid | 118 | 'Colorful Grid' TableStyle (MS WORD 2010). |
ColorfulGridAccent1 | 119 | 'Colorful Grid Accent 1' TableStyle (MS WORD 2010). |
ColorfulGridAccent2 | 120 | 'Colorful Grid Accent 2' TableStyle (MS WORD 2010). |
ColorfulGridAccent3 | 121 | 'Colorful Grid Accent 3' TableStyle (MS WORD 2010). |
ColorfulGridAccent4 | 122 | 'Colorful Grid Accent 4' TableStyle (MS WORD 2010). |
ColorfulGridAccent5 | 123 | 'Colorful Grid Accent 5' TableStyle (MS WORD 2010). |
ColorfulGridAccent6 | 124 | 'Colorful Grid Accent 6' TableStyle (MS WORD 2010). |
See Developer Guide: Insert a TOC (Table of Contents) field
using System; using SautinSoft.Document; using System.Text; namespace Example { class Program { static void Main(string[] args) { // Get your free 100-day key here: // https://sautinsoft.com/start-for-free/ InsertingToc(); } /// <summary> /// Insert a TOC (Table of Contents) field into the document using DocumentBuilder. /// </summary> /// <remarks> /// Details: https://www.sautinsoft.com/products/document/help/net/developer-guide/documentbuilder-inserting-toc.php /// </remarks> static void InsertingToc() { DocumentCore dc = new DocumentCore(); DocumentBuilder db = new DocumentBuilder(dc); // Insert the formatted text into the document using DocumentBuilder. db.CharacterFormat.FontName = "Verdana"; db.CharacterFormat.Size = 16; db.Writeln("Table of Contents."); db.CharacterFormat.ClearFormatting(); // Insert Table of Contents field into the document at the current position. TableOfEntries toe = db.InsertTableOfContents("\\o \"1-3\" \\h"); // For information about switches, see the description on the page above. // Add the text and divide it into headings. db.InsertSpecialCharacter(SpecialCharacterType.PageBreak); ParagraphStyle Heading1Style = (ParagraphStyle)Style.CreateStyle(StyleTemplateType.Heading1, dc); dc.Styles.Add(Heading1Style); db.ParagraphFormat.Style = Heading1Style; db.Writeln("Heading 1"); db.ParagraphFormat.ClearFormatting(); db.Writeln("Some text Heading 1 Some text Heading 1 Some text Heading 1 Some text Heading 1 Some text Heading 1 Some text Heading 1" + "Some text Heading 1 Some text Heading 1 Some text Heading 1 Some text Heading 1 Some text Heading 1 Some text Heading 1 "); ParagraphStyle Heading2Style = (ParagraphStyle)Style.CreateStyle(StyleTemplateType.Heading2, dc); dc.Styles.Add(Heading2Style); db.ParagraphFormat.Style = Heading2Style; db.Writeln("Heading 1.1"); db.ParagraphFormat.ClearFormatting(); db.Writeln("Some text Heading 1.1 Some text Heading 1.1 Some text Heading 1.1 Some text Heading 1.1 Some text Heading 1.1" + " Some text Heading 1.1 Some text Heading 1.1 Some text Heading 1.1 Some text Heading 1.1"); db.ParagraphFormat.Style = Heading2Style; db.Writeln("Heading 1.2"); db.ParagraphFormat.ClearFormatting(); db.Writeln("Some text Heading 1.2 Some text Heading 1.2 Some text Heading 1.2 Some text Heading 1.2 Some text Heading 1.2" + " Some text Heading 1.2 Some text Heading 1.2 Some text Heading 1.2 "); ParagraphStyle Heading3Style = (ParagraphStyle)Style.CreateStyle(StyleTemplateType.Heading3, dc); dc.Styles.Add(Heading3Style); db.ParagraphFormat.Style = Heading3Style; db.Writeln("Heading 1.1.1"); db.ParagraphFormat.ClearFormatting(); db.Writeln("Some text Heading 1.1.1 Some text Heading 1.1.1 Some text Heading 1.1.1 Some text Heading 1.1.1 " + " Some text Heading 1.1.1 Some text Heading 1.1.1 Some text Heading 1.1.1 "); db.ParagraphFormat.Style = Heading3Style; db.Writeln("Heading 1.1.2"); db.ParagraphFormat.ClearFormatting(); db.Writeln("Some text 1.1.2 Some text 1.1.2 Some text 1.1.2 Some text 1.1.2"); db.ParagraphFormat.Style = Heading1Style; db.Writeln("Heading 2"); db.ParagraphFormat.ClearFormatting(); db.Writeln("Some text Heading 2 Some text Heading 2."); db.ParagraphFormat.Style = Heading1Style; db.Writeln("Heading 3"); db.ParagraphFormat.ClearFormatting(); db.Writeln("Some text Heading 3 Some text Heading 3 Some text Heading 3 Some text Heading 3 Some text Heading 3" + "Some text Heading 3Some text Heading 3Some text Heading 3Some text Heading 3Some text Heading 3"); db.ParagraphFormat.Style = Heading2Style; db.Writeln("Heading 3.1"); db.ParagraphFormat.ClearFormatting(); db.Writeln("Some text Heading 3.1 Some text Heading 3.1 Some text Heading 3.1 Some text Heading 3.1 Some text Heading 3.1" + "Some text Heading 3.1 Some text Heading 3.1 Some text Heading 3.1"); db.ParagraphFormat.Style = Heading2Style; db.Writeln("Heading 3.2"); db.ParagraphFormat.ClearFormatting(); db.Writeln("Some text Heading 3.2 Some text Heading 3.2 Some text Heading 3.2 Some text Heading 3.2 Some text Heading 3.2"); // Update the TOC field (table of contents). toe.Update(); // Save our document into DOCX format. string resultPath = @"Result.docx"; dc.Save(resultPath, new DocxSaveOptions()); // Important for Linux: Install MS Fonts // sudo apt install ttf-mscorefonts-installer -y // Open the result for demonstration purposes. System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo(resultPath) { UseShellExecute = true }); } } }
Imports System Imports SautinSoft.Document Imports System.Text Namespace Example Friend Class Program Shared Sub Main(ByVal args() As String) InsertingToc() End Sub ''' Get your free 100-day key here: ''' https://sautinsoft.com/start-for-free/ ''' <summary> ''' Insert a TOC (Table of Contents) field into the document using DocumentBuilder. ''' </summary> ''' <remarks> ''' Details: https://www.sautinsoft.com/products/document/help/net/developer-guide/documentbuilder-inserting-toc.php ''' </remarks> Private Shared Sub InsertingToc() Dim dc As New DocumentCore() Dim db As New DocumentBuilder(dc) ' Insert the formatted text into the document using DocumentBuilder. db.CharacterFormat.FontName = "Verdana" db.CharacterFormat.Size = 16 db.Writeln("Table of Contents.") db.CharacterFormat.ClearFormatting() ' Insert Table of Contents field into the document at the current position. Dim toe As TableOfEntries = db.InsertTableOfContents("\o ""1-3"" \h") ' For information about switches, see the description on the page above. ' Add the text and divide it into headings. db.InsertSpecialCharacter(SpecialCharacterType.PageBreak) Dim Heading1Style As ParagraphStyle = CType(Style.CreateStyle(StyleTemplateType.Heading1, dc), ParagraphStyle) dc.Styles.Add(Heading1Style) db.ParagraphFormat.Style = Heading1Style db.Writeln("Heading 1") db.ParagraphFormat.ClearFormatting() db.Writeln("Some text Heading 1 Some text Heading 1 Some text Heading 1 Some text Heading 1 Some text Heading 1 Some text Heading 1" & "Some text Heading 1 Some text Heading 1 Some text Heading 1 Some text Heading 1 Some text Heading 1 Some text Heading 1 ") Dim Heading2Style As ParagraphStyle = CType(Style.CreateStyle(StyleTemplateType.Heading2, dc), ParagraphStyle) dc.Styles.Add(Heading2Style) db.ParagraphFormat.Style = Heading2Style db.Writeln("Heading 1.1") db.ParagraphFormat.ClearFormatting() db.Writeln("Some text Heading 1.1 Some text Heading 1.1 Some text Heading 1.1 Some text Heading 1.1 Some text Heading 1.1" & " Some text Heading 1.1 Some text Heading 1.1 Some text Heading 1.1 Some text Heading 1.1") db.ParagraphFormat.Style = Heading2Style db.Writeln("Heading 1.2") db.ParagraphFormat.ClearFormatting() db.Writeln("Some text Heading 1.2 Some text Heading 1.2 Some text Heading 1.2 Some text Heading 1.2 Some text Heading 1.2" & " Some text Heading 1.2 Some text Heading 1.2 Some text Heading 1.2 ") Dim Heading3Style As ParagraphStyle = CType(Style.CreateStyle(StyleTemplateType.Heading3, dc), ParagraphStyle) dc.Styles.Add(Heading3Style) db.ParagraphFormat.Style = Heading3Style db.Writeln("Heading 1.1.1") db.ParagraphFormat.ClearFormatting() db.Writeln("Some text Heading 1.1.1 Some text Heading 1.1.1 Some text Heading 1.1.1 Some text Heading 1.1.1 " & " Some text Heading 1.1.1 Some text Heading 1.1.1 Some text Heading 1.1.1 ") db.ParagraphFormat.Style = Heading3Style db.Writeln("Heading 1.1.2") db.ParagraphFormat.ClearFormatting() db.Writeln("Some text 1.1.2 Some text 1.1.2 Some text 1.1.2 Some text 1.1.2") db.ParagraphFormat.Style = Heading1Style db.Writeln("Heading 2") db.ParagraphFormat.ClearFormatting() db.Writeln("Some text Heading 2 Some text Heading 2.") db.ParagraphFormat.Style = Heading1Style db.Writeln("Heading 3") db.ParagraphFormat.ClearFormatting() db.Writeln("Some text Heading 3 Some text Heading 3 Some text Heading 3 Some text Heading 3 Some text Heading 3" & "Some text Heading 3Some text Heading 3Some text Heading 3Some text Heading 3Some text Heading 3") db.ParagraphFormat.Style = Heading2Style db.Writeln("Heading 3.1") db.ParagraphFormat.ClearFormatting() db.Writeln("Some text Heading 3.1 Some text Heading 3.1 Some text Heading 3.1 Some text Heading 3.1 Some text Heading 3.1" & "Some text Heading 3.1 Some text Heading 3.1 Some text Heading 3.1") db.ParagraphFormat.Style = Heading2Style db.Writeln("Heading 3.2") db.ParagraphFormat.ClearFormatting() db.Writeln("Some text Heading 3.2 Some text Heading 3.2 Some text Heading 3.2 Some text Heading 3.2 Some text Heading 3.2") ' Update the TOC field (table of contents). toe.Update() ' Save our document into DOCX format. Dim resultPath As String = "result.docx" dc.Save(resultPath, New DocxSaveOptions()) ' Open the result for demonstration purposes. System.Diagnostics.Process.Start(New System.Diagnostics.ProcessStartInfo(resultPath) With {.UseShellExecute = True}) End Sub End Class End Namespace