Skip to content

Instantly share code, notes, and snippets.

@openize-com-gists
Created June 16, 2025 07:04
Show Gist options
  • Select an option

  • Save openize-com-gists/a386b4ad99dfe8a7e2b9195ce3413af0 to your computer and use it in GitHub Desktop.

Select an option

Save openize-com-gists/a386b4ad99dfe8a7e2b9195ce3413af0 to your computer and use it in GitHub Desktop.
C# Read Multiple Multilevel List Paragraphs in Word Documents

C# Read Multiple Multilevel List Paragraphs in Word Documents

using System;
namespace OpenizeMultilevelListsPropertiesExample
{
class Program
{
static void Main(string[] args)
{
// Prerequisite: Install Openize.Words NuGet package
// Install-Package Openize.Words
// Load the Word Document
var doc = new Openize.Words.Document($"MultilevelLists.docx");
// Initialize the body with the document
var body = new Openize.Words.Body(doc);
//System.Collections.Generic.List<Openize.Words.IElements.Paragraph>
// paragraphs = body.Paragraphs;
var paragraphs = body.Paragraphs;
foreach (Openize.Words.IElements.Paragraph paragraph in paragraphs)
{
System.Console.WriteLine($"Paragraph Text : {paragraph.Text}");
System.Console.WriteLine($"Paragraph NumberingId : {paragraph.NumberingId}");
System.Console.WriteLine($"Paragraph Numbered? : {paragraph.IsNumbered}");
System.Console.WriteLine($"Paragraph Roman? : {paragraph.IsRoman}");
System.Console.WriteLine($"Paragraph AlphabeticNumber? : {paragraph.IsAlphabeticNumber}");
System.Console.WriteLine($"Paragraph Numbering Level : {paragraph.NumberingLevel}");
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment