Mac OS X
Components Crossplatform Mac & Win Server Client Old Guides Examples
New in version: 8.4 8.5 9.0 9.1 9.2 9.3 9.4 9.5 10.0 10.1 Statistic
Replaces a placeholder with text.
|Component||Version||macOS||Windows||Server||FileMaker Cloud||FileMaker iOS SDK|
|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.
The new text. Should not contain newline characters.
Pass 1 to replace all placeholders with same text.
Returns OK or error.
DescriptionReplaces a placeholder with text.
The place holder in the document must start with « and end with » characters. The place holder you pass here, should not have those quotes.
If you need to replace multi line text like addresses, please use several placeholders, at least one per line. Or for newer plugin pass text with new lines, but that will only work for main text and not headers.
If you need to insert multiple entries, you can do this:
Ask the plugin for the XML of the document via WordFile.GetXML. Split the XML into the part before your template line, the template and the xml after. Your line probably is wrapped between a <p> and </p>. Now you can build a new XML with your content and repeat the template part with new text as often as needed. Than pass back the XML to the plugin via WordFile.SetXML.
Version 7.0 and newer can handle multi line text better for normal paragraphs. It creates for you new paragraphs for each line in the new text.
If you change font or style of the text within the marker, it will not be recognized. So please keep all text between and including the « and » markers (or whatever is configured) within the same font style.
Replaces placeholder with text:
Replaces all placeholder with text:
Replace some tags:
- MBS FileMaker Plugin, version 9.4pr5
- MBS FileMaker Plugin, version 9.2pr2
- MBS FileMaker Plugin, version 7.4pr3
- MBS FileMaker Plugin, version 7.2pr1
- MBS FileMaker Plugin, version 7.0pr1
- Ausgabe 6/2016, Seite 39
- Version 9.4
- Fixed a bug in WordFile.ReplaceTag where it would not update the modified XML correctly for replace in header section.
- Version 9.2
- Changed WordFile.ReplaceTag to look for tags in document properties.
- Version 7.4
- Changed WordFile.ReplaceTag to be case insensitive for ASCII characters.
- Version 7.2
- Fixed bug in WordFile.ReplaceTag with several tags in one line.
- Version 7.0
- Changed WordFile.ReplaceTag to create multiple paragraphs if text to replace contains multiple lines and is part of a normal text paragraph.
Created 5th November 2015, last changed 6th September 2019
Feedback: Report problem or ask question.
MBS Xojo Plugins