WPTools Manual



Search


(press enter to search)

Function TWPRTFDataCollectionBase.CodeLocatePair(FormatName:string; spar:TParagraph; epar:TParagraph; spos:Integer; epos:Integer; global:Boolean) : Integer

Unit: WPRTEDefs
Class: WPRTEDefs.TWPRTFDataCollectionBase

Parameters

Returns

The type of the result value is Integer.

Description

Locates paired objects based on the given FormatName. This FormatName uses this syntax: "X:text" or "X:text=".
X can be one of this letters:
lowercase letters:
c: search for wpobjCustom comparing the object name = text
f: search for wpobjMergeField
h: search for wpobjHyperlink
b: search for wpobjBookmark
p: search for wpobjTextProtection
s: search for wpobjSPANStyle
capital letters:
C: search for wpobjCustom comparing the object source parameter = text
F: search for wpobjMergeField etc.
If the FormatName was processed the function will return the count of characters which were interpreted. If a pair was found spar and epar will be > nil - otherwise nothing was found!

It is also possible to locate a named paragraph (using property WPAT_PAR_NAME) with @:PARNAME=.... This makes sense to load and save data of sub paragraphs in the Save and Load methods.