PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Seeks a character string in a Word Processing document.
Caution: This documentation presents the last features of the Word Processing control. Make sure that all the necessary modules are updated.
Example
arrFragments is array of docFragments = DocSeek(WP_MyDocument, "%CustomerName%")
// Replace all "%CustomerName%" by the customer name
FOR EACH f OF arrFragments
f..Text = Customer.Name
END
// Seeks "BEAUTIFUL" in the text
// Selects the first one found to change its color
arrFragments is array of docFragments = DocSeek(WP_NoName1, "BEAUTIFUL")

IF arrFragments..Occurrence >= 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 = abFragments[1]..EndPosition - abFragments[1]..StartPosition+1
// Modify the text color
abFragments[1]..Style..TextColor = PastelRed
BREAK
END
// Seeks "BEAUTIFUL" in the text
// Selects the first one found to change its color
arrFragments is array of docFragments = DocSeek(WP_NoName1, "BEAUTIFUL")

IF arrFragments..Occurrence >= 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> = DocSeek(<Document> , <Text to Find> [, <Options>])
<Result>: Array of docFragment variables
Array of docFragment variables corresponding to all the document fragments where the sought text was found.
<Document>: Document variable or character string (with or without quotes)
Document to use. This document corresponds to:
  • WINDEV the name of a Word Processing control.
  • a Document variable.
<Text to Find>: Character string (with quotes)
Text to find in the document
<Options>: Optional constant (or combination of constants)
Search options:
WholeWordSearch for the whole word (enclosed in punctuation characters or in space characters).
IgnoreCaseSearch while ignoring the case (lowercase/uppercase characters) and the accented characters.

The search is case sensitive by default: the sought text and the text to find must have the same case. To perform a search while ignoring the case, use the IgnoreCase constant.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230mdl.dll
Linux wd230mdl.so
Minimum required version
  • Version 22
This page is also available for…
Comments
Click [Add] to post a comment