Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.4   6.5   7.0   7.1   7.2   7.3   7.4   7.5   8.0   8.1    Statistic  


Replaces text in current rich text document with new text.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
RichText 6.4 Yes No Yes, macOS only No No

MBS( "RichText.ReplaceTexts"; SearchTextList; NewTextList { ; Multiple } )


Parameter Description Example value
SearchTextList The list of texts to search. Search is case insensitive. "$FirstName"
NewTextList The list of new text to use as replacement. Can be empty. "Christian"
Multiple Optional
Optional, Pass 1 to replace all occurrences. Default is 0 to replace the first one found.


Returns OK or error.


Replaces text in current rich text document with new text.
While RichText.ReplaceText replaces just one value, this function can replace a list of value.
This can be used to load Word file (DOC, RTF, DOCX), replace place holders with values for client and save a personalized copy.


Replaces text to test function:

Let ( [
r1 = MBS( "RichText.ReadText"; "Hello World. Greetings from FileMaker."; "UTF-8" );
r2 = MBS( "RichText.ReplaceTexts"; "Hello¶World¶from¶FileMaker¶Greetings"; "Hallo¶Leute¶aus¶FileMaker!¶Grüße"; 0 );
r = MBS( "RichText.Text" );
r3 = MBS( "RichText.Clear" )
];r )

See also

RichText.ReplaceText   -   RichText.SetAttribute

Feedback: Report problem or ask question.

MBS Xojo Plugins