TextRange2 members (Office)
Represents the text frame in a Shape or ShapeRange object.
Methods
Name | Description |
---|---|
AddPeriods | Adds period (.) punctuation to the right side of the text contained in TextRange2 object for left-to-right languages and on the left side for right-to-left languages. |
ChangeCase | Changes the case of a TextRange2 object to one of the values in the MsoTextChangeCase enumeration. |
Copy | Copies a TextRange2 object. |
Cut | Removes a portion or all of the text from a range of text. |
Delete | Deletes a TextRange2 object. |
Find | Searches a TextRange2 object for a subset of text. |
InsertAfter | Inserts text to the right of the existing text in the TextRange2 object. |
InsertBefore | Inserts text to the left of the existing text in the TextRange2 object. |
InsertChartField | Inserts a field into the body of a data label in a chart. |
InsertSymbol | Inserts a symbol from the specified font set into the range of text represented by the TextRange2 object. |
Item | Gets the range of text specified by the index number from the TextRange2 object. |
LtrRun | Returns a TextRange2 object that represents the specified subset of left-to-right text runs. A text run consists of a range of characters that share the same font attributes. |
Paste | Pastes the contents of the Clipboard into the TextRange2 object. |
PasteSpecial | Replaces the text range with the contents of the Clipboard in the format specified. If the paste succeeds, this method returns a TextRange2 object including the text range that was pasted. |
RemovePeriods | Removes all period (.) punctuation from the text in the TextRange2 object. |
Replace | Finds specific text in a text range, replaces the found text with a specified string, and returns a TextRange2 object that represents the first occurrence of the found text. Returns Nothing if no match is found. |
RotatedBounds | Gets the coordinates of the vertices of the text bounding box for the specified text range. Read-only. |
RtlRun | Returns a TextRange2 object that represents the specified subset of right-to-left text runs. A text run consists of a range of characters that share the same font attributes. |
Select | Selects the TextRange2 object. |
TrimText | Returns a TextRange2 object that represents the specified text that has the whitespace removed. |
Properties
Name | Description |
---|---|
Application | When used without an object qualifier, this property returns an Application object that represents the current instance of the Microsoft Office application. When used with an object qualifier, this property returns an Application object that represents the creator of the TextRange2 object. When used with an OLE Automation object, it returns the object's application. Read-only. |
BoundHeight | Gets the height, in points, of the text bounding box for the specified text. Read-only. |
BoundLeft | Gets the left coordinate, in points, of the text bounding box for the specified text. Read-only. |
BoundTop | Gets the top coordinate, in points, of the text bounding box for the specified text. Read-only. |
BoundWidth | Gets the width, in points, of the text bounding box for the specified text. Read-only. |
Characters | Read-only. |
Count | Gets a Long indicating the number of items in the TextRange2 collection. Read-only. |
Creator | Gets a 32-bit integer that indicates the application in which the TextRange2 object was created. Read-only. |
Font | Returns a Font object that represents character formatting for the TextRange2 object. Read-only. |
LanguageID | Gets or sets the MsoLanguageID value of the TextRange2 object. Read/write. |
Length | Get a Long that represents the length of a text range. Read-only. |
Lines | Returns a TextRange2 object that represents the specified subset of text lines. Read-only. |
MathZones | Sets the starting point and length of a math zone within a text range. Read-only. |
ParagraphFormat | Returns a ParagraphFormat object that represents paragraph formatting for the specified text. Read-only. |
Paragraphs | Gets a TextRange2 object that represents the specified subset of text paragraphs. Read-only. |
Parent | Gets the Parent object for the TextRange2 object. Read-only. |
Runs | Gets a TextRange2 object that represents the specified subset of text runs. A text run consists of a range of characters that share the same font attributes. Read-only. |
Sentences | Returns a TextRange2 object that represents the specified subset of text sentences. Read-only. |
Start | Gets a Long value indicating the starting point of the specified text range. Read-only. |
Text | Gets or sets a String value that represents the text in a text range. Read/write. |
Words | Gets a TextRange2 object that represents the specified subset of text words. Read-only. |
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.