Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

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

Select an option

Save openize-words-gists/cf5e6290218466bfc50f5feab50c2f85 to your computer and use it in GitHub Desktop.
C# Read Multiple Multilevel List Paragraphs in Word Documents
// Prerequisite: Install <a href="https://www.nuget.org/packages/Openize.Words">Openize.Words</a>.
// 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);
var paragraphs = body.Paragraphs;
foreach (var 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