Paragraph Class |
The Paragraph type exposes the following members.
Name | Description | |
---|---|---|
Paragraph(DocumentCore) | Initializes a new instance of the Paragraph. | |
Paragraph(DocumentCore, Inline) | Initializes a new instance of the Paragraph. | |
Paragraph(DocumentCore, IEnumerableInline) | Initializes a new instance of the Paragraph. | |
Paragraph(DocumentCore, String) | Initializes a new instance of the Paragraph. |
Name | Description | |
---|---|---|
CharacterFormatForParagraphMark | Gets or sets the character format for the paragraph mark. | |
ElementType |
Gets the ElementType of this element instance.
(Overrides ElementElementType) | |
FrameFormat | Gets the text frame format. | |
Inlines | Gets the paragraph's inlines. | |
IsDeleteRevision | Returns true if this paragraph was deleted in Microsoft Word while change tracking was enabled. | |
IsInsertRevision | Returns true if this paragraph was inserted in Microsoft Word while change tracking was enabled. | |
IsMoveFromRevision | Returns true if this paragraph was moved (deleted) in Microsoft Word while change tracking was enabled. | |
IsMoveToRevision | Returns true if this paragraph was moved (inserted) in Microsoft Word while change tracking was enabled. | |
ListFormat | Gets or sets the list format. | |
ListItem | Gets the list item or null if paragraph doesn't have list item. | |
ParagraphFormat | Gets or sets the paragraph format. |
See Developer Guide: Creates a new document with a paragraph
using SautinSoft.Document; namespace Example { class Program { static void Main(string[] args) { // Get your free 100-day key here: // https://sautinsoft.com/start-for-free/ Paragraph(); } /// <summary> /// Creates a new document with a paragraph. /// </summary> /// <remarks> /// Details: https://sautinsoft.com/products/document/help/net/developer-guide/paragraph.php /// </remarks> static void Paragraph() { DocumentCore dc = new DocumentCore(); string filePath = @"Result-file.docx"; dc.Sections.Add( new Section(dc, new Paragraph(dc, "Text is right aligned.") { ParagraphFormat = new ParagraphFormat { Alignment = HorizontalAlignment.Right } }, new Paragraph(dc, "This paragraph has the following properties: Left indentation is 15 points, right indentation is 5 centimeters, hanging indentation is 10 points, line spacing is exactly 14 points, space before and space after are 10 points.") { ParagraphFormat = new ParagraphFormat { LeftIndentation = 15, RightIndentation = LengthUnitConverter.Convert(5, LengthUnit.Centimeter, LengthUnit.Point), SpecialIndentation = 10, LineSpacing = 14, LineSpacingRule = LineSpacingRule.Exactly, SpaceBefore = 10, SpaceAfter = 10 } })); dc.Save(filePath); System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo(filePath) { UseShellExecute = true }); } } }
Imports System Imports System.IO Imports SautinSoft.Document Module Sample Sub Main() Paragraphs() End Sub ''' Get your free 100-day key here: ''' https://sautinsoft.com/start-for-free/ ''' <summary> ''' Creates a new document with a paragraph. ''' </summary> ''' <remarks> ''' Details: https://sautinsoft.com/products/document/help/net/developer-guide/paragraph.php ''' </remarks> Public Sub Paragraphs() Dim dc As New DocumentCore() Dim filePath As String = "Result-file.docx" dc.Sections.Add(New Section(dc, New Paragraph(dc, "Text is right aligned.") With { .ParagraphFormat = New ParagraphFormat With {.Alignment = HorizontalAlignment.Right} }, New Paragraph(dc, "This paragraph has the following properties: Left indentation is 15 points, right indentation is 5 centimeters, hanging indentation is 10 points, line spacing is exactly 14 points, space before and space after are 10 points.") With { .ParagraphFormat = New ParagraphFormat With { .LeftIndentation = 15, .RightIndentation = LengthUnitConverter.Convert(5, LengthUnit.Centimeter, LengthUnit.Point), .SpecialIndentation = 10, .LineSpacing = 14, .LineSpacingRule = LineSpacingRule.Exactly, .SpaceBefore = 10, .SpaceAfter = 10 } })) dc.Save(filePath) System.Diagnostics.Process.Start(New System.Diagnostics.ProcessStartInfo(filePath) With {.UseShellExecute = True}) End Sub End Module