ITextStrings interface

The ITextStrings interface represents a collection of rich-text strings that are useful for manipulating rich text. In particular, you can use the collection to convert linearly formatted math expressions into built-up form and vice versa. You can also use the collection to collect the concatenation of a set of rich-text strings, or to manipulate a string without changing a primary story. The collection is efficiently implemented by concatenating the strings in a scratch story and maintaining an array of the string counts that identify the strings.

When to implement

Applications typically do not implement the ITextStrings interface. Microsoft text solutions, such as rich edit controls, implement ITextStrings as part of their TOM implementations.

When to use

Applications can retrieve an ITextStrings object by calling the ITextDocument2::GetStrings method.

If the ITextStrings collection contains one or more strings, an application can use the ITextStrings::Item method to retrieve an ITextRange2 object for the string at a particular index.

Members

The ITextStrings interface inherits from the IDispatch interface. ITextStrings also has these types of members:

Methods

The ITextStrings interface has these methods.

MethodDescription
Add

Adds a string to the end of the collection.

Append

Appends a string to the string at the specified index in the collection.

Cat2

Concatenates two strings.

CatTop2

Inserts text between the top two strings in a collection.

DeleteRange

Deletes the contents of a given range.

EncodeFunction

Encodes an object, given a set of argument strings.

GetCch

Gets the count of characters for a selected string index.

GetCount

Gets the number of strings in a string collection.

InsertNullStr

Inserts a NULL string in the collection at a selected string index.

Item

Gets an ITextRange2 object for a selected index in a string collection.

MoveBoundary

Moves the start boundary of a string, by index, for a selected number of characters.

PrefixTop

Prefixes a string to the top string in the collection.

Remove

Removes a string from a string collection, starting at an index.

SetFormattedText

Replaces text with formatted text.

SetOpCp

Sets the character position in the source range's story that has desired character formatting attributes. The ITextStrings::EncodeFunction method applies those character formatting attributes to the operators specified by the Char, Char1, and Char2 parameters.

SuffixTop

Suffixes a string to the top string in the collection.

Swap

Swaps the top two strings in the collection.

 

Requirements

Minimum supported client

Windows 8 [desktop apps only]

Minimum supported server

Windows Server 2012 [desktop apps only]

Header

Tom.h

DLL

Msftedit.dll

 

 

Community Additions

ADD
Show:
© 2014 Microsoft