Version

xamRichTextEditor - Replay-Only Methods

Topic Overview

Purpose

This topic provides information about the xamRichTextEditor™ control’s testable user replay-only methods.

XamRichTextEditor Replay-Only Methods

SetUpdateMode

Description

Sets the update mode for the xamRichTextEditor .

Parameters

The following table describes the method’s parameter followed by code example.

Method parameter Description

oeUpdateMode

Validates if the xamRichTextEditor has a document and editable.

Example

To change the current update mode from Insert to Overwrite.

…XamRichTextEditor("Identifier").SetUpdateMode igOverwrite

Possible exceptions

The following is the list of possible exceptions to the method and the likely reason causing them.

Exception reasons

  • The option supplied is not one of the valid options, valid options are [igInsert|igOverwrite]

  • The operation cannot be performed because the xamRichTextEditor does not have a document loaded

  • Editing is not allowed

FindNextInstanceOfText

Description

Finds the next instance of the supplied text, starting from the current caret location and moving the caret to the start of the next occurrence of that text moving towards the end of the document.

Parameters

The following table describes the method’s parameter followed by code example.

Method parameter Description

sTextToFind

String value representing the text to be found.

iSkipCount

Represents integer value representing the number of text instances to be skipped, default value is 0.

bCaseSensitive

Represents Boolean value representing search criteria – if case sensitive, default is true.

bAllowWildCards

Represents Boolean value representing search criteria – if used with wildcards, default is false.

Wildcard logic is identical the Visual Basic Like operator.

Example

To find the next instance of “ word ” from the current caret position.

…XamRichTextEditor("Identifier").FindNextInstanceOfText “word”

To find the sixth instance of “ WoRd ” from the current caret position, case insensitively.

…XamRichTextEditor("Identifier").FindNextInstanceOfText “WoRd”, 5, false

To find the next instance of “ w?rd ” from the current caret position. The following example will pick up word, “ wOrd ”, “ ward ”, etc. The wildcard ( ? ) is identical to the Visual Basic Like operator.

…XamRichTextEditor("Identifier").FindNextInstanceOfText “WoRd”, 0, false, true

Possible exceptions

There was an error finding the text: [ sTextToFind ]

SelectAllInstancesOfText

Description

Finds and selects all instances of the supplied text moving towards the end of the document. If nothing is found, no text is selected.

Parameters

The following table describes the method’s parameter followed by code example.

Method parameter Description

sTextToFind

String value representing the text to be found.

bCaseSensitive

Represents Boolean value representing search criteria – if case sensitive, default is true.

bAllowWildCards

Represents Boolean value representing search criteria – if used with wildcards, default is false.

Wildcard logic is identical the Visual Basic Like operator.

Example

To find and select all instances of “ word ” from the current caret position.

…XamRichTextEditor("Identifier").SelectAlltInstanceOfText “Word”

To find and select all instances of “ WoRd ” case insensitively.

…XamRichTextEditor("Identifier").SelectAllInstancesOfText “WoRd”, false

To find all instances of “ w?rd ”. This will pick up “ word ”, “ wOrd ”, “ ward ”, etc. The wildcard ( ? ) is identical to the Visual Basic Like operator.

…XamRichTextEditor("Identifier").SelectAllInstancesOfText “w?rd”, false, true

Possible exceptions

There was an error finding the text: [ sTextToFind ]

ReplaceNextInstanceOfText

Description

Replaces the next instance of the supplied text, starting from the current caret location and moving the caret to the next start of that text moving towards the end of the document.

Parameters

The following table describes the method’s parameter followed by code example.

Method parameter Description

sTextToFind

String value representing the text to be found.

sNewText

String value representing the new text to replace the existing text.

iSkipCount

Represents integer value representing the number of text instances to be skipped, default value is 0.

bCaseSensitive

Represents Boolean value representing search criteria – if case sensitive, default is true.

bAllowWildCards

Represents Boolean value representing search criteria – if used with wildcards, default is false.

Example

To find the next instance of “ word ” from the current caret position and replace it with “ NewWord ”.

…XamRichTextEditor("Identifier").ReplaceNextInstanceOfText “word”, “NewWord”

To find the sixth instance of “ WoRd ” from the current caret position, case insensitively and replace it with “ NewWord ”.

…XamRichTextEditor("Identifier").ReplaceNextInstanceOfText “WoRd”, “NewWord”, 5, false

To find the next instance of “ w?rd ” from the current caret position. This will pick up “ word ”, “ wOrd ”, “ ward ”, etc. The wildcard ( ? ) is identical to the Visual Basic Like operator.

…XamRichTextEditor("Identifier").ReplaceNextInstanceOfText “w?rd”, “”, 0, false, true

Possible exceptions

The following is the list of possible exceptions to the method and the likely reason causing them.

Exception reasons

  • The following item [sTextToFind] was not found

  • There was an error in finding the text: [sTextToFind]

ReplaceAllInstancesOfText

Description

Finds and replaces all instances of the supplied text.

Parameters

The following table describes the method’s parameter followed by code examples.

Method parameter Description

sTextToFind

String value representing the text to be found.

sNewText

String value representing the new text to replace the existing text.

bCaseSensitive

Represents Boolean value representing search criteria – if case sensitive, default is true.

bAllowWildCards

Represents Boolean value representing search criteria – if used with wildcards, default is false.

Example

To find and remove all instances of “ word ”.

…XamRichTextEditor("Identifier").ReplaceAllInstancesOfText “word”

To find and replace all instances of “ word ” with “ NewWord ”.

…XamRichTextEditor("Identifier").ReplaceAllInstancesOfText “word”, “NewWord”

To find and select all instances of “ WoRd ” case insensitively and replace it with “ NewWord ”.

…XamRichTextEditor("Identifier").ReplaceAllInstancesOfText “WoRd”, “NewWord”, false

To find all instances of “ w?rd ”. This will pick up “ word ”, “ wOrd ”, “ ward ”, etc. The wildcard ( ? ) is identical to the Visual Basic Like operator. It replaces all found instances of the text with “ NewWord ”.

…XamRichTextEditor("Identifier").ReplaceAllInstancesOfText “w?rd”, “NewWord”, false, true

Possible exceptions

The following is the list of possible exceptions to the method and the likely reason causing them.

Exception reasons

  • The following item [sTextToFind] was not found

  • There was an error in finding the text: [sTextToFind]

Related Content

Topics

The following topics provide additional information related to this topic.

Topic Purpose

This topic provides information about the xamRichTextEditor control’s testable user actions and elements.

This topic provides information about recording and replaying actions using the xamRichTextEditor control’s testable user methods.

This topic provides reference information about the xamRichTextEditor control’s test object properties.

This topic provides reference material on the common enumerations used for testing the xamRichTextEditor control.