Represents a single paragraph of text in a Range.
For a list of all members of this type, see Paragraph Members.
System.Object
Aspose.Editor.Desktop.Paragraph
[Visual Basic]
NotInheritable Public Class Paragraph
[C#]public sealed class Paragraph
Remarks
You do not create instances of this class directly. You can create or obtain Paragraph objects from the Paragraphs collection. The Paragraphs collection, in turn, is available from a Range object.
A paragraph of text in a document and a Paragraph instance are distinct entities. Although a document consists of paragraphs of text, individual Paragraph objects are not automatically created for each and every paragraph of text when the document is loaded as it would be a waste of system resources. Also, paragraphs of text are often joined and split because of the editing operations. Therefore, Paragraph objects are proxy-like objects that are automatically created and maintained by Aspose.Editor on demand, to make it easier for you to work with the document programmatically.
Example
Gets the first paragraph in the document and turns into bold and centered.
[C#]
Document doc = new Document(MyPath + "Welcome.xml");
Range docRange = doc.GetRange();
Paragraph para = docRange.Paragraphs[0];
Range paraRange = para.GetRange();
paraRange.Bold = true;
paraRange.ParagraphFormat.Alignment = ParagraphAlignment.Center;
doc.Save(MyPath + "ExRange.ParaRange Out.xml");
[Visual Basic]
Dim doc As New Document(MyPath & "Welcome.xml")
Dim docRange As Range = doc.GetRange()
Dim para As Paragraph = docRange.Paragraphs(0)
Dim paraRange As Range = para.GetRange()
paraRange.Bold = True
paraRange.ParagraphFormat.Alignment = ParagraphAlignment.Center
doc.Save(MyPath & "ExRange.ParaRange Out.xml")
Requirements
Namespace: Aspose.Editor.Desktop
Assembly: Aspose.Editor.Desktop (in Aspose.Editor.Desktop.dll)
See Also
Paragraph Members | Aspose.Editor.Desktop Namespace | Range