ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Controls, pages and windows / Word Processing functions
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 a character string in an entire Word Processing control.
Example
arrFragments is array of docFragments = WP_MyDocument.Find("%CustomerName%")
// Replace all "%CustomerName%" by the customer name
FOR EACH f OF arrFragments
f.Text = Customer.Name
END
// Find "BEAUTIFUL" in the text
// Selects the first one found to change its color
arrFragments is array of docFragments = WP_NoName1.Find("BEAUTIFUL")
 
IF arrFragments.Count >= 1 THEN
// Position the cursor at the beginning of the first word found
WP_NoName1.Cursor = arrFragments[1].StartPosition
// Calculate the selection length
WP_NoName1.SelectionLength = ...
arrFragments[1].EndPosition - arrFragments[1].StartPosition+1
// Modify the text color
arrFragments[1].Formatting.TextColor = PastelRed
BREAK
END
Syntax
<Result> = <Word Processing control>.Search(<Text to find> [, <Options>])
<Result>: Array of docFragment variables
Array of docFragment variables corresponding to all the document fragments where the searched text was found.
<Word Processing control>: Control name
Name of the Word Processing control to use.
<Text to find>: Character string
Text to find in the control.
<Options>: Optional constant (or combination of constants)
Search options:
IgnoreCaseCase and accent insensitive search (ignores uppercase and lowercase differences).
WholeWordSearch for the whole word (enclosed in punctuation characters or in space characters).

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

Last update: 06/21/2023

Send a report | Local help