Previous Document Next Document

Object Model Reference : Classes : P : Page : Methods : Page.TextReplace


Page.TextReplace

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

Description

Member of Page

The Replace method finds and replaces a specified text string.

Parameter
Description
OldText
Specifies the text to be replaced
NewText
Specifies the new text
CaseSensitive
Specifies whether the search string is case-sensitive
ReplaceSelectedOnly
Specifies whether only the selected text is to be replaced with the TextReplace method. This parameter is optional, and its default value is True.

VBA example

The following VBA example creates three text objects and replaces the word Some with Short (resulting 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 2013 Corel Corporation. All rights reserved.