TextParagraph Class
Represents a paragraph of text.
- Inheritance:
- System.ObjectTextParagraph
Properties
Elements
Gets the paragraph text elements.
public TextElementCollection Elements { get; }
Public ReadOnly Property Elements As TextElementCollection
Property Value
The paragraph text elements.
Format
Gets or sets the paragraph's formatting options.
public TextParagraphFormat Format { get; set; }
Public Property Format As TextParagraphFormat
Property Value
The paragraph's formatting options.
Remarks
This property always returns a new instance of a TextParagraphFormat that points to data associated with this paragraph. This reduces memory footprint since simpler internal structures can be used to hold the data and execution time increase is negligible since Garbage Collector has a very good performance for a short-lived (Generation 0) objects.
When setting a value, instance of a TextParagraphFormat won't actually be stored in this paragraph, but the data to which the instance points to will be copied. This enables easy copying of complex properties from one text element to another.
Parent
Property Value
- System.Object
Slide
Gets the slide associated with this text paragraph.
Property Value
The slide associated with this text paragraph.
TextContent
Gets the content range of the current TextParagraph.
Property Value
The content range of the current TextParagraph.
Remarks
The property always returns a new instance of the TextRange class.
For more information, see Find and Replace example.
Methods
AddField(TextFieldType)
Adds a new text field to the paragraph.
[ComVisible(false)]
public TextField AddField(TextFieldType fieldType)
<ComVisible(False)>
Public Function AddField(fieldType As TextFieldType) As TextField
Parameters
fieldType
- TextFieldType
Type of the field. Text property is set based on the field type.
Returns
The text field added to the paragraph.
AddField(String, String)
Adds a new text field to the paragraph.
[ComVisible(true)]
public TextField AddField(string fieldType, string text)
<ComVisible(True)>
Public Function AddField(fieldType As String, text As String) As TextField
Parameters
fieldType
- System.String
Type of the field that is not supported by TextFieldType enumeration.
text
- System.String
The field text.
Returns
The text field added to the paragraph.
Exceptions
- System.ArgumentException
Parameter text
contains character '\v', '\r' or '\n'. Character '\v' represents a line break and a TextLineBreak instance should be added instead. Characters '\r' and '\n' represent a paragraph break and a TextParagraph instance should be added instead.
AddLineBreak()
Adds a new line break to the paragraph.
Returns
The line break added to the paragraph.
AddRun(String)
Adds a new run of text to the paragraph.
Parameters
text
- System.String
The text.
Returns
The run of text added to the paragraph.
Exceptions
- System.ArgumentException
Parameter text
is either null or System.String.Empty, or it contains character '\v', '\r' or '\n'. Character '\v' represents a line break and a TextLineBreak instance should be added instead. Characters '\r' and '\n' represent a paragraph break and a TextParagraph instance should be added instead.
ToString()
Returns a System.String that represents this TextParagraph instance.
Returns
- System.String
A System.String that represents this TextParagraph instance.