ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Controls, pages and windows / Word Processing functions
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Finds all the instances of a character string and replaces them with another string in a Document variable.
Example
MyDocument is Document

// Replace all "%CustomerName%" by the customer name
MyDocument.Replace("%CustomerLastName%", Customer.LastName)
MyDocument is Document

// Replace "Presentation" by "PRESENTATION"
MyDocument.Replace("Presentation", "PRESENTATION", WholeWord)
Syntax
<Document>.Replace(<Text to replace> , <Replacement text> [, <Options>])
<Document>: Document variable
Name of the Document variable to be used.
<Text to replace>: Character string
Text to find and to replace in the document. If this parameter corresponds to an empty string (""), the document will not be modified.
<Replacement text>: Character string
Character string that will replace <Text to replace>. If this parameter corresponds to an empty string (""), all the occurrences of <Text to replace> will be deleted
<Options>: Optional constant (or combination of constants)
Search options for the text to replace:
IgnoreCaseCase and accent insensitive search (ignores uppercase and lowercase differences).
WholeWordWhole word search (enclosed in punctuation characters or spaces).

By default, the search is case sensitive: the text searched for must have the same case as the text to be found. To perform a case-insensitive search, use the IgnoreCase constant.
Warning: The replacement does not take into account the writing direction..
Business / UI classification: UI Code
Component: wd300mdl.dll
Minimum version required
  • Version 24
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 09/24/2024

Send a report | Local help