Created
May 22, 2024 13:57
-
-
Save openize-words-gists/9bfed3dedf0fe2c085427a281cb9473e to your computer and use it in GitHub Desktop.
C# Read Roman Alphabetic Paragraphs in Word Documents
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Prerequisite: Install <a href="https://www.nuget.org/packages/Openize.Words">Openize.Words</a>. | |
// Load the Word Document | |
var doc = new Openize.Words.Document($"WordParagraphsRomanAlphabetic.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