Paragraph

Overview

Paragraph is a class in Aspose.Words FOSS for .NET. Inherits from: CompositeNode, IParaAttrSource, IRunAttrSource, and 1 more.

Represents a paragraph of text.

This class provides 35 methods for working with Paragraph objects in .NET programs. Available methods include: Accept, AcceptEnd, AcceptStart, AppendChild, AppendField, Clone, CreateNavigator, GetAncestor, GetAncestorOf, GetChild, GetChildNodes, GetEffectiveTabStops, and 19 additional methods. All public members are accessible to any .NET application after installing the Aspose.Words FOSS for .NET package. Properties: BreakIsStyleSeparator, Count, CustomNodeId, Document, FirstChild, FrameFormat, and 26 more.

Properties

NameTypeAccessDescription
NodeTypeNodeTypeReadReturns Paragraph.
ParentStoryStoryReadRetrieves the parent section-level story that can be Body or HeaderFooter.
ParentSectionSectionReadRetrieves the parent Section of the paragraph.
IsInCellboolReadTrue if this paragraph is an immediate child of Cell; false otherwise.
IsEndOfCellboolReadTrue if this paragraph is the last paragraph in a Cell; false otherwise.
BreakIsStyleSeparatorboolReadTrue if this paragraph break is a Style Separator.
IsEndOfSectionboolReadTrue if this paragraph is the last paragraph in the Body (main text story) of a Section; false otherwise.
IsEndOfHeaderFooterboolReadTrue if this paragraph is the last paragraph in the HeaderFooter (main text story) of a Section; false otherwise.
IsEndOfDocumentboolReadTrue if this paragraph is the last paragraph in the last section of the document.
ParagraphFormatParagraphFormatReadProvides access to the paragraph formatting properties.
ListFormatListFormatReadProvides access to the list formatting properties of the paragraph.
FrameFormatFrameFormatReadProvides access to the frame formatting properties.
ListLabelListLabelReadGets a ListLabel object that provides access to list numbering value and formatting for this paragraph.
RunsRunCollectionReadProvides access to the typed collection of pieces of text inside the paragraph.
ParagraphBreakFontFontReadProvides access to the font formatting of the paragraph break character.
IsInsertRevisionboolReadGets the is insert revision.
IsDeleteRevisionboolReadGets the is delete revision.
IsMoveFromRevisionboolReadGets the is move from revision.
IsMoveToRevisionboolReadGets the is move to revision.
IsFormatRevisionboolReadGets the is format revision.
IsListItemboolReadTrue when the paragraph is an item in a bulleted or numbered list in original revision.
IsCompositeboolReadReturns true as this node can have child nodes.
HasChildNodesboolReadReturns true if this node has any child nodes.
FirstChildNodeReadGets the first child of the node.
LastChildNodeReadGets the last child of the node.
CountintReadGets the number of immediate children of this node.
ParentNodeCompositeNodeReadGets the immediate parent of this node.
DocumentDocumentBaseReadGets the document to which this node belongs.
PreviousSiblingNodeReadGets the node immediately preceding this node.
NextSiblingNodeReadGets the node immediately following this node.
RangeRangeReadReturns a Range object that represents the portion of a document that is contained in this node.
CustomNodeIdintRead/WriteSpecifies custom node identifier.

Methods

SignatureDescription
Paragraph(doc: DocumentBase)Initializes a new instance of the Paragraph class.
Accept(visitor: DocumentVisitor)Calls VisitParagraphStart, then calls Accept for all child nodes of the paragraph and calls VisitParagraphEnd at the end.
AcceptStart(visitor: DocumentVisitor)Accepts a visitor for visiting the start of the document’s paragraph.
AcceptEnd(visitor: DocumentVisitor)Accepts a visitor for visiting the end of the document’s paragraph.
GetText()Gets the text of this paragraph including the end of paragraph character.
GetEffectiveTabStops()Returns array of all tab stops applied to this paragraph, including applied indirectly by styles or lists.
JoinRunsWithSameFormatting()Joins runs with the same formatting in the paragraph.
AppendField(fieldType: FieldType, updateField: bool)Appends a Word field to this paragraph.
AppendField(fieldCode: string)Appends a field to this paragraph.
AppendField(fieldCode: string, fieldValue: string)Appends a field to this paragraph.
InsertField(fieldType: FieldType, updateField: bool, refNode: Node, isAfter: bool)Inserts a Word field into this paragraph.
InsertField(fieldCode: string, refNode: Node, isAfter: bool)Inserts a field into this paragraph.
InsertField(fieldCode: string, fieldValue: string, refNode: Node, isAfter: bool)Inserts a field into this paragraph.
GetChildNodes(nodeType: NodeType, isDeep: bool)Returns a collection of child nodes that match the specified type.
GetChild(nodeType: NodeType, index: int, isDeep: bool)Returns an Nth child node that matches the specified type.
SelectNodes(xpath: string)Selects a list of nodes matching the XPath expression.
SelectSingleNode(xpath: string)Selects the first Node that matches the XPath expression.
GetEnumerator()Provides support for the for each style iteration over the child nodes of this node.
AppendChild(newChild: T)Adds the specified node to the end of the list of child nodes for this node.
PrependChild(newChild: T)Adds the specified node to the beginning of the list of child nodes for this node.
InsertAfter(newChild: T, refChild: Node)Inserts the specified node immediately after the specified reference node.
InsertBefore(newChild: T, refChild: Node)Inserts the specified node immediately before the specified reference node.
RemoveChild(oldChild: T)Removes the specified child node.
RemoveAllChildren()Removes all the child nodes of the current node.
RemoveSmartTags()Removes all SmartTag descendant nodes of the current node.
IndexOf(child: Node)Returns the index of the specified child node in the child node array.
CreateNavigator()Creates navigator which can be used to traverse and read nodes.
Clone(isCloneChildren: bool)You should use the Clone(bool, INodeCloningListener) overload when the node cloning is a part of another (usually composite) node cloning process.
GetAncestor(ancestorType: Type)Gets the first ancestor of the specified object type.
GetAncestorOf()Calls GetAncestorOf on this Paragraph instance.
Remove()Removes itself from the parent.
NextPreOrder(rootNode: Node)Gets next node according to the pre-order tree traversal algorithm.
PreviousPreOrder(rootNode: Node)Gets the previous node according to the pre-order tree traversal algorithm.
ToString(saveFormat: SaveFormat)Exports the content of the node into a string in the specified format.
NodeTypeToString(nodeType: NodeType)A utility method that converts a node type enum value into a user friendly string.

See Also