Previous Document Next Document
Page.TextReplace

Sub TextReplace(OldText As String, NewText As String, CaseSensitive As Boolean, [ReplaceSelectedOnly As Boolean = True])

Member of Page

The Replace method finds and replaces the specified text string.

Parameters
Description
OldText
Specifies a text string, contained in quotation marks, indicating the text in a text range that is replaced
NewText
Represents a text string, contained in quotation marks, indicating the text that replaces the text specified in the OldText parameter
CaseSensitive
Determines whether the search string should look for case-sensitive text
ReplaceSelectedOnly
Determines whether only the selected text is to be replaced with the TextReplace method
This parameter is optional, and its default value is True.

The following code example creates three text objects and replaces the word Some with Short (which results in one of the text objects becoming Short Sentence):

Sub Test() 
 ActiveLayer.CreateArtisticText 0, 0, "Text1" 
 ActiveLayer.CreateArtisticText 0, 3, "Some Sentence." 
 ActiveLayer.CreateArtisticText 0, 5, "Word" 
 ActivePage.TextReplace "Some", "Short", True, False 
End Sub 

Previous Document Next Document Back to Top

Copyright 2007 Corel Corporation. All rights reserved.