Share via


TextRange2 Members

Include Protected Members
Include Inherited Members

Represents the text frame in a Shape or ShapeRange objects.

The TextRange2 type exposes the following members.

Properties

  Name Description
Public property Application (Inherited from _IMsoDispObj.)
Public property Application Used without an object qualifier, this property returns an Application object that represents the current instance of the Microsoft Office application. Used with an object qualifier, this property returns an Application object that represents the creator of the TextFrame2 object. When used with an OLE Automation object, it returns the object's application. Read-only.
Public property BoundHeight Gets the height, in points, of the text bounding box for the specified text. Read-only.
Public property BoundLeft Gets the left coordinate, in points, of the text bounding box for the specified text. Read-only.
Public property BoundTop Gets the top coordinate, in points, of the text bounding box for the specified text. Read-only.
Public property BoundWidth Gets the width, in points, of the text bounding box for the specified text. Read-only.
Public property Characters Read-only.
Public property Count Gets the number of items in the TextRange2 collection. Read-only.
Public property Creator (Inherited from _IMsoDispObj.)
Public property Creator Gets a 32-bit integer that indicates the application in which the TextRange2 object was created. Read-only.
Public property Font Returns a Font object that represents character formatting for the TextRange2 object. Read-only.
Public property LanguageID Gets or sets the MsoLanguageID value of the TextRange2 object. Read/write.
Public property Length Gets the length of a text range. Read-only.
Public property Lines Returns the specified subset of text lines. Read-only.
Public property MathZones
Public property ParagraphFormat Returns the paragraph formatting for the specified text. Read-only.
Public property Paragraphs Gets the specified subset of text paragraphs. Read-only.
Public property Parent Gets the parent object for the TextRange2 object. Read-only.
Public property Runs Gets the specified subset of text runs. A text run consists of a range of characters that share the same font attributes. Read-only.
Public property Sentences Returns the specified subset of text sentences. Read-only.
Public property Start Gets the starting point of the specified text range. Read-only.
Public property Text Gets or sets a String value that represents the text in a text range. Read/write.
Public property Words Gets the specified subset of text words. Read-only.

Top

Methods

  Name Description
Public method AddPeriods Adds period (.) punctuation to the right side of the text contained in TextFrame2 object for left-to-right languages and on the left side for right-to-left languages.
Public method ChangeCase Changes the case of a TextRange2 object to one of the values in the MsoTextChangeCase enumeration.
Public method Copy Copies a TextRange2 object.
Public method Cut Removes a portion or all of the text from a range of text.
Public method Delete Deletes a TextRange2 object.
Public method Find Searches a TextRange2 object for a subset of text.
Public method GetEnumerator() (Inherited from IEnumerable.)
Public method GetEnumerator()
Public method InsertAfter Inserts text to the right of the existing text in the TextRange2 object.
Public method InsertBefore Inserts text to the left of the existing text in the TextRange2 object.
Public method InsertSymbol Inserts a symbol from the specified font set into the range of text represented by the TextRange2 object.
Public method Item Gets the range of text specified by the index number from the TextRange2 object.
Public method 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.
Public method Paste Pastes the contents of the Clipboard into the TextRange2 object.
Public method 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.
Public method RemovePeriods Removes all period (.) punctuation from the text in the TextRange2 object.
Public method 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.
Public method RotatedBounds Gets the coordinates of the vertices of the text bounding box for the specified text range. Read-only.
Public method 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.
Public method Select Selects the TextRange2 object.
Public method TrimText Returns the specified text minus any trailing spaces.

Top

See Also

Reference

TextRange2 Interface

Microsoft.Office.Core Namespace