Previous Document Next Document

Object Model Reference : Classes : T : Text : Methods : Text.Find


Text.Find

Function Find(Text As String, CaseSensitive As Boolean, [StartIndex As Long = 1], [WrapAround As Boolean = False], [IndexingType As cdrTextIndexingType = cdrCharacterIndexing]) As Long

Description

Member of Text

The Find method locates a specified text string in a text stream.

Parameter
Description
Text
Specifies the text to find
CaseSensitive
Specifies whether to match the case of the text in the Text parameter
StartIndex
Specifies the first text object in a text range. If the index type is set to word, and the start index is 3, the StartIndex parameter begins the range at the third word in the selected text frame. This parameter is optional, and its default value is 1.
WrapAround
Specifies whether the text follows the path of an object’s shape or bounding box. This parameter is optional, and its default value is False.
IndexingType
Specifies, through a value of cdrTextIndexingType, the type of text to find. The indexing type can be character, word, or paragraph. This parameter is optional, and its default value is cdrCharacterIndexing (0).

VBA example

The following VBA example creates a paragraph-text object containing the text Lorem Dolor Sit. It then looks for the word Dolor and inserts the word Ipsum (plus a space) in front of the text, resulting in the string Lorem Ipsum Dolor Sit.

Sub Test()
 Dim s As Shape, n As Long
 Set s = ActiveLayer.CreateParagraphText(0, 0, 2, 1, "Lorem Dolor Sit")
 n = s.Text.Find("Dolor", False)
 If n <> 0 Then s.Text.Characters(n, 0) = "Ipsum "
End Sub

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.