Upravit

Sdílet prostřednictvím


TextRange2 Interface

Definition

Represents the text frame in a Shape or ShapeRange objects.

public interface class TextRange2 : Microsoft::Office::Core::_IMsoDispObj, System::Collections::IEnumerable
[System.Runtime.InteropServices.Guid("000C0397-0000-0000-C000-000000000046")]
public interface TextRange2 : Microsoft.Office.Core._IMsoDispObj, System.Collections.IEnumerable
[<System.Runtime.InteropServices.Guid("000C0397-0000-0000-C000-000000000046")>]
type TextRange2 = interface
    interface _IMsoDispObj
    interface IEnumerable
Public Interface TextRange2
Implements _IMsoDispObj, IEnumerable
Attributes
Implements

Remarks

This object contains the text in the text frame as well as the properties and methods that control the alignment and anchoring of the text frame. Use the TextFrame2 property to return a TextFrame2 object.

Properties

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.

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[Int32, Int32]

Read-only.

Count

Gets 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

Gets the length of a text range. Read-only.

Lines[Int32, Int32]

Returns the specified subset of text lines. Read-only.

MathZones[Int32, Int32]
ParagraphFormat

Returns the paragraph formatting for the specified text. Read-only.

Paragraphs[Int32, Int32]

Gets the specified subset of text paragraphs. Read-only.

Parent

Gets the parent object for the TextRange2 object.

Read-only.

Runs[Int32, Int32]

Gets the specified subset of text runs. A text run consists of a range of characters that share the same font attributes. Read-only.

Sentences[Int32, Int32]

Returns the specified subset of text sentences. Read-only.

Start

Gets 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[Int32, Int32]

Gets the specified subset of text words. Read-only.

Methods

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.

ChangeCase(MsoTextChangeCase)

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(String, Int32, MsoTriState, MsoTriState)

Searches a TextRange2 object for a subset of text.

GetEnumerator()
InsertAfter(String)

Inserts text to the right of the existing text in the TextRange2 object.

InsertBefore(String)

Inserts text to the left of the existing text in the TextRange2 object.

InsertChartField(MsoChartFieldType, String, Int32)

Inserts a field into the body of a data label in a chart.

InsertSymbol(String, Int32, MsoTriState)

Inserts a symbol from the specified font set into the range of text represented by the TextRange2 object.

Item(Object)

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(MsoClipboardFormat)

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(String, String, Int32, MsoTriState, MsoTriState)

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(Single, Single, Single, Single, Single, Single, Single, Single)

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 the specified text minus any trailing spaces.

Applies to