PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
This content has been translated automatically. Click here to view the French version.
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Finds all the instances of a character string and replaces them with another string:
  • in an entire Word Processing document.
  • Versions 24 and later
    in a fragment.
    New in version 24
    in a fragment.
    in a fragment.
Caution: This documentation presents the last features of the Word Processing control. Make sure that all the necessary modules are updated.
Example
// Remplacement de tous les "%NomClient%" par le nom du client
DocReplace(TT_MonDocument, "%NomClient%", Client.Nom)
// Replacement du mot "Présentation" par "PRESENTATION"
DocReplace(TT_SansNom1, "Présentation", "PRESENTATION", WholeWord)
Syntax
DocReplace(<Search scope> , <Text to replace> , <Replacement text> [, <Options>])
<Search scope>: Document variable, docFragment variable or control name
Element in which the the find and replace must be done. This element can correspond to:
  • WINDEV the name of a Word Processing control.
  • a variable of type Document.
  • Versions 24 and later
    to an variable of type docFragment.
    New in version 24
    to an variable of type docFragment.
    to an variable of type docFragment.
<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:
WholeWordSearch for the whole word (enclosed in punctuation characters or in space characters).
IgnoreCaseCase and accent insensitive search (ignores uppercase and lowercase differences).

By default, the search is case-sensitive: the searched text and the text to find must have the same case. To perform a search while ignoring the case, use the IgnoreCase constant.
Business / UI classification: UI Code
Component: wd270mdl.dll
Minimum version required
  • Version 22
This page is also available for…
Comments
Click [Add] to post a comment