How to update the style levels for TOC in word using VB.NET


  • Hi team,

             How will I update levels for the word TOC using VB.NET

    I want to change from attached image before.png to After.png


     After.png :!AkmlUDcbhtXiicZnlH45yWdurnUC2A

    Thanks in advance

    Tuesday, April 4, 2017 6:58 PM

All replies

  • Hi Prem-,

    According to your description, I find this article that may be helpful to you, please refer to:

    Best Regards,

    Cherry Bu

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact

    Wednesday, April 5, 2017 5:02 AM
  • Hi Prem,

    I think you can use Spire.Doc to create and update Table Of Contents in Word document.

    Refer to below code:

    Dim doc As New Document()
    Dim section As Section = doc.AddSection()
    Dim para As Paragraph = section.AddParagraph()
    para.AppendTOC(1, 3)
    Dim para1 As Paragraph = section.AddParagraph()
    Dim para2 As Paragraph = section.AddParagraph()
    doc.SaveToFile("CreateTableOfContent.docx", FileFormat.Docx)
    You can check the How to Create Table of Contents (TOC) in C# article for detailed information.

    Wednesday, April 5, 2017 5:53 AM