Add Paragraph The "add-paragraph" feature in IronWord allows developers to insert entire paragraphs into an existing Word document, providing an efficient way to structure and organize content. By adding a paragraph, developers can combine multiple pieces of text, each with different formatting, into a cohesive block. This feature is especially useful for constructing dynamic documents where text needs to be grouped and styled together, such as reports, articles, or letters. It offers flexibility in how text is presented, enabling the inclusion of various formatting options like bold, italic, and other styles within a single paragraph. The ability to add paragraphs helps maintain a clean document structure and ensures content is properly organized for readability. Adding Paragraphs in C# The Paragraph class in IronWord represents a block of text that can contain both unstyled text and styled content. When working with paragraphs, developers can combine plain TextContent with styled Run objects to create rich, formatted text blocks. To add plain text directly to a paragraph, use the AddText method with a TextContent object. This is ideal for unstyled text that doesn't require specific formatting. For styled content, create a Run object containing TextContent, then assign a TextStyle to the Run. The TextStyle can specify formatting such as bold, italic, font family, font size, and color. Once the Run is styled, use the AddChild method to add it to the paragraph. This method is specifically designed for adding Run objects with formatting. A single paragraph can contain multiple runs with different styles, allowing for flexible text formatting within a unified block. After constructing the paragraph with all desired content, use AddParagraph on the WordDocument to insert it into the document. This approach follows the document hierarchy: WordDocument → DocumentSection → Paragraph → Run → TextContent, ensuring proper structure and formatting preservation when the document is saved. Explore more on Document Elements with IronWord Related Docs Links View on Github Related Tutorial Related How-To Guide Class Documentation Download IronWord DLL Report an Issue on this page Ready to Get Started? Nuget Downloads 32,664 | Version: 2026.2 just released Free NuGet Download Total downloads: 32,664 View Licenses
All your questions are answered to make sure you have all the information you need. (No commitment whatsoever.)