Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
12.2
12.3
12.4
12.5
13.0
13.1
13.2
13.3
13.4
13.5
Statistic
FMM
Blog
Replaces a placeholder with text.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
WordFile | 5.4 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameter | Description | Example | Flags |
---|---|---|---|
WordFile | The reference number of the open word file. | $wordFile | |
Placeholder | The name of the placeholder. In plugin version 7.4 and newer case insensitive for ASCII characters. |
"City" | |
Text | The new text. | "New York" | Optional |
All | Pass 1 to replace all placeholders with same text. | 1 | Optional |
Returns OK or error.
Replaces placeholder with text:
Set Variable [$r; Value:MBS("WordFile.ReplaceTag"; $WordFile; "City"; "Nickenich")]
Replaces all placeholder with text:
Set Variable [$r; Value:MBS("WordFile.ReplaceTag"; $WordFile; "City"; "Nickenich"; 1)]
Replace some tags:
# load from container
Set Variable [ $wordfile ; Value: MBS( "WordFile.OpenContainer"; WordFile::Input ) ]
If [ MBS("ISError") ]
Show Custom Dialog [ "Error" ; $wordFile ]
Exit Current Script [ Result: ]
End If
# replace placeholders from one record
Set Variable [ $r ; Value: MBS( "WordFile.ReplaceTag"; $WordFile; "FG_Nr"; WordFile::FG_Nr.) ]
Set Variable [ $r ; Value: MBS( "WordFile.ReplaceTag"; $WordFile; "P_Name"; WordFile::P_Name) ]
Set Variable [ $r ; Value: MBS( "WordFile.ReplaceTag"; $WordFile; "P_Vorname"; WordFile::P_Vorname) ]
# write to desktop
Set Variable [ $DesktopPath ; Value: MBS("Folders.UserDesktop") ]
Set Variable [ $FilePath ; Value: MBS( "Path.AddPathComponent"; $DesktopPath; "test output.docx" ) ]
Set Variable [ $r ; Value: MBS( "WordFile.WriteFile"; $WordFile; $FilePath ) ]
Set Variable [ $r ; Value: MBS( "Files.LaunchFile"; $FilePath ) ]
# clean up
Set Variable [ $r ; Value: MBS("WordFile.Release"; $WordFile) ]
This function checks for a license.
Created 5th November 2015, last changed 8th August 2021