Click or drag to resize
TextSelection Class
Represents a text range with selection highlighting.
Inheritance Hierarchy

Namespace: TextObjectModel
Assembly: ManagedTOM2 (in ManagedTOM2.dll) Version: 1.0.5577.41188
Syntax
public class TextSelection : TextRange

The TextSelection type exposes the following members.

Methods
  NameDescription
Public methodAddSubrange
(TOM 2 only) Adds a subrange to this range.
(Inherited from TextRange.)
Public methodCode exampleBuildUpMath
(TOM 2 only) Converts the linear-format math in a range to a built-up form, or modifies the current built-up form.
(Inherited from TextRange.)
Public methodCode exampleChangeCase
Changes the case of letters in this range according to the type parameter.
(Inherited from TextRange.)
Public methodCode exampleClone
Gets a duplicate of this range object.
(Inherited from TextRange.)
Public methodCode exampleCollapse
Collapses the specified text range into a degenerate point at either the beginning or end of the range.
(Inherited from TextRange.)
Public methodCopy
Copies the text to the clipboard.
(Inherited from TextRange.)
Public methodCut
Cuts the plain or rich text to the clipboard.
(Inherited from TextRange.)
Public methodDelete
Mimics the DELETE and BACKSPACE keys, with and without the CTRL key depressed.
(Inherited from TextRange.)
Public methodDeleteSubrange
(TOM 2 only) Deletes a subrange from the range.
(Inherited from TextRange.)
Public methodDispose (Inherited from TextRange.)
Protected methodDispose(Boolean)
Releases the unmanaged resources used by the TextSelection and optionally releases the managed resources
(Overrides TextRangeDispose(Boolean).)
Public methodEndKey
Mimics the functionality of the End key.
Public methodCode exampleEndOf
Moves this range's ends to the end of the last overlapping unit in the range.
(Inherited from TextRange.)
Public methodEquals(Object)
Tests if this object is considered equal to another.
(Inherited from TextRange.)
Public methodEquals(TextRange)
Determines whether this range has the same character positions and story as those of a specified range.
(Inherited from TextRange.)
Public methodCode exampleExpand
Expands this range so that any partial units it contains are completely contained.
(Inherited from TextRange.)
Protected methodFinalize (Inherited from TextRange.)
Public methodFind
(TOM 2 only) Searchs for math inline functions in text as specified by a source range.
(Inherited from TextRange.)
Public methodCode exampleFindText(String, RangeMatchType)
Searches to the end of the story for the text given by text. The matching criteria are given by flags.
(Inherited from TextRange.)
Public methodCode exampleFindText(String, Int32, RangeMatchType)
Searches up to count characters for the text given by text. The starting position and direction are also specified by count, and the matching criteria are given by flags.
(Inherited from TextRange.)
Public methodFindTextEnd(String, RangeMatchType)
Searches to the end of the story for text, starting from the range's end.
(Inherited from TextRange.)
Public methodFindTextEnd(String, Int32, RangeMatchType)
Searches up to count characters for text, starting from the range's end.
(Inherited from TextRange.)
Public methodFindTextStart(String, RangeMatchType)
Searches to the end of the story for text, starting at the range's start.
(Inherited from TextRange.)
Public methodFindTextStart(String, Int32, RangeMatchType)
Searches up to count characters for text, starting at the range's start.
(Inherited from TextRange.)
Public methodGetCells
(TOM 2 only) Gets the cells in the range.
(Inherited from TextRange.)
Public methodGetChar
(TOM 2 only) Gets the character at the specified offset from the end of this range.
(Inherited from TextRange.)
Public methodGetColumn
(TOM 2 only) Gets the column in the range.
(Inherited from TextRange.)
Public methodCode exampleGetDataObject
Returns an IDataObject containing the text in the range.
(Inherited from TextRange.)
Public methodGetDropCap
(TOM 2 only) Gets the line and position of the drop cap.
(Inherited from TextRange.)
Public methodGetEmbeddedObject
Retrieves the embedded object at the start of the specified range. The range must either be an insertion point or it must select only the embedded object.
(Inherited from TextRange.)
Public methodGetHashCode
Returns the hash code for the object.
(Inherited from TextRange.)
Public methodGetIndex
Retrieves the story index of the unit parameter at the specified range start character position. The first unit in a story has an index value of 1. The index of a Unit is the same for all character positions from that immediately preceding the unit up to the last character in the unit.
(Inherited from TextRange.)
Public methodGetMathFunctionType
(TOM 2 only) Retrieves the math function type associated with the specified math function name.
(Inherited from TextRange.)
Public methodGetPoint
Retrieves screen coordinates for the start or end character position in the text range, along with the intra-line position.
(Inherited from TextRange.)
Public methodGetProperty
(TOM 2 only) Gets the value of a property.
(Inherited from TextRange.)
Public methodGetRectangle
(TOM 2 only) Retrieves a rectangle of the specified type for the current range.
(Inherited from TextRange.)
Public methodGetRow
(TOM 2 only) Gets the row properties in the currently selected row.
(Inherited from TextRange.)
Public methodGetSubrange
(TOM 2 only) Retrieves a subrange in a range.
(Inherited from TextRange.)
Public methodGetTable
(TOM 2 only) Gets the table in the range.
(Inherited from TextRange.)
Public methodGetText
(TOM 2 only) Gets the text in this range according to the specified conversion flags.
(Inherited from TextRange.)
Public methodHexToUnicode
(TOM 2 only) Converts and replaces the hexadecimal number at the end of this range to a Unicode character.
(Inherited from TextRange.)
Public methodHomeKey
Mimics the functionality of the Home key.
Public methodInRange
Determines whether this range is within or at the same text as a specified range.
(Inherited from TextRange.)
Public methodCode exampleInsertImage
(TOM 2 only) Inserts a table in a range.
(Inherited from TextRange.)
Public methodInsertTable
(TOM 2 only) Inserts a table in a range.
(Inherited from TextRange.)
Public methodCode exampleLinearize
(TOM 2 only) Translates the built-up math, ruby, and other inline objects in this range to linearized form.
(Inherited from TextRange.)
Public methodCode exampleMove
Moves the insertion point forward or backward a specified number of units. If the range is nondegenerate, the range is collapsed to an insertion point at either end, depending on count, and then is moved.
(Inherited from TextRange.)
Public methodMoveDown
Mimics the functionality of the Down Arrow and Page Down keys.
Public methodCode exampleMoveEnd
Moves the end position of the range.
(Inherited from TextRange.)
Public methodCode exampleMoveEndUntil
Moves the range's end to the character position of the first character found that is in the set of characters specified by chars.
(Inherited from TextRange.)
Public methodCode exampleMoveEndWhile
Moves the end of the range just past all contiguous characters that are found in the set of characters specified by chars, whichever is less.
(Inherited from TextRange.)
Public methodMoveLeft
Generalizes the functionality of the Left Arrow key.
Public methodMoveRight
Generalizes the functionality of the Right Arrow key.
Public methodCode exampleMoveStart
Moves the start position of the range.
(Inherited from TextRange.)
Public methodCode exampleMoveStartUntil
Moves the range's start to the character position of the first character found that is in the set of characters specified by chars.
(Inherited from TextRange.)
Public methodCode exampleMoveStartWhile
Moves the start position of the range just past all contiguous characters that are found in the set of characters specified by chars.
(Inherited from TextRange.)
Public methodCode exampleMoveUntil
Searches for the first character in the set of characters specified by chars. If a character is found, the range is collapsed to that point.
(Inherited from TextRange.)
Public methodMoveUp
Mimics the functionality of the Up Arrow and Page Up keys.
Public methodCode exampleMoveWhile
Starts at the end of the range and searches while the characters belong to the set specified by chars. The range is collapsed to an insertion point when a non-matching character is found.
(Inherited from TextRange.)
Public methodPaste
Pastes text from the clipboard.
(Inherited from TextRange.)
Public methodScrollIntoView
Scrolls the range into view.
(Inherited from TextRange.)
Public methodSelect
Sets the start and end positions, and story values of the active selection, to those of this range.
(Inherited from TextRange.)
Public methodSetActiveSubrange
(TOM 2 only) Makes the specified subrange the active subrange of this range.
(Inherited from TextRange.)
Public methodCode exampleSetDataObject
Replaces the text in the range with the specified data object.
(Inherited from TextRange.)
Public methodSetDropCap
(TOM 2 only) Sets the line and position of the drop cap.
(Inherited from TextRange.)
Public methodSetFormattedText
Sets the formatted text of this range text to the formatted text of the specified range.
(Inherited from TextRange.)
Public methodSetIndex
Changes this range to the specified unit of the story.
(Inherited from TextRange.)
Public methodSetPoint
Changes the range based on a specified point at or up through (depending on extend) the point (x, y) aligned according to position.
(Inherited from TextRange.)
Public methodSetProperty
(TOM 2 only) Sets the value of the specified property.
(Inherited from TextRange.)
Public methodSetRange
Adjusts the range endpoints to the specified values.
(Inherited from TextRange.)
Public methodSetText
(TOM 2 only) Sets the text of this range.
(Inherited from TextRange.)
Public methodCode exampleStartOf
Moves the range ends to the start of the first overlapping Unit in the range.
(Inherited from TextRange.)
Public methodToString
Returns the plain text in the range.
(Inherited from TextRange.)
Public methodTypeText
Types the string given by text at this selection as if someone typed it. This is similar to setting the Text property, but is sensitive to the Insert/Overtype key state and UI settings like AutoCorrect and smart quotes.
Public methodUnicodeToHex
(TOM 2 only) Converts the Unicode character(s) preceding the start position of this text range to a hexadecimal number, and selects it.
(Inherited from TextRange.)
Top
Extension Methods
  NameDescription
Public Extension MethodAppend
Appends text to the end of the range.
(Defined by TextExtensions.)
Public Extension MethodAppendLine
Appends text, followed by a newline character, to the end of the range.
(Defined by TextExtensions.)
Public Extension MethodClear
Clears the text in the range.
(Defined by TextExtensions.)
Public Extension MethodInsert
Inserts text at the specified position within the range.
(Defined by TextExtensions.)
Public Extension MethodRemove
Removes a sequence of characters from the range.
(Defined by TextExtensions.)
Public Extension MethodCode exampleToMathML
Returns a string containing the W3C MathML (MML) markup for the math text in the range.
(Defined by TextExtensions.)
Public Extension MethodCode exampleToOfficeMathML
Returns a string containing the Office MathML (OMML) markup for the math text in the range.
(Defined by TextExtensions.)
Top
Properties
  NameDescription
Public propertyCanEdit
Gets a value determining whether the specified range can be edited.
(Inherited from TextRange.)
Public propertyCanPaste
Gets a value determining if data on the clipboard can be pasted into the current range.
(Inherited from TextRange.)
Public propertyChar
Gets or sets the character at the start position of the range.
(Inherited from TextRange.)
Public propertyEnd
Gets or sets the end character position of the range.
(Inherited from TextRange.)
Public propertyFlags
Gets or sets the text selection flags.
Public propertyFont
Gets or sets a TextFont object with the character attributes of the specified range.
(Inherited from TextRange.)
Public propertyGravity
(TOM 2 only) Gets or sets the gravity of this range.
(Inherited from TextRange.)
Public propertyCode exampleInlineObject
(TOM 2 only) Gets or sets the properties of the inline object at the range active end.
(Inherited from TextRange.)
Public propertyLength
Gets or sets the length of the range.
(Inherited from TextRange.)
Public propertyPara
Gets or sets a TextPara object with the paragraph attributes of the specified range.
(Inherited from TextRange.)
Public propertyRtf
Gets or sets the content of the range as a Rich Text Format (RTF) string.
(Inherited from TextRange.)
Public propertyStart
Gets or sets the start character position of the range.
(Inherited from TextRange.)
Public propertyStartPara
(TOM 2 only) Gets the character position of the start of the paragraph that contains the range's start character position.
(Inherited from TextRange.)
Public propertySubrangeCount
(TOM 2 only) Gets the count of subranges, including the active subrange in the current range.
(Inherited from TextRange.)
Public propertyText
Gets or sets the plain text in this range.
(Inherited from TextRange.)
Public propertyType
Gets the type of text selection.
Public propertyURL
(TOM 2 only) Gets or sets the URL text associated with a range.
(Inherited from TextRange.)
Top
Remarks
Managed wrapper class for the COM interface ITextSelection, including ITextSelection2 functionality.
See Also