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.1
12.2
12.3
12.4
12.5
13.0
13.1
13.2
13.3
13.4
Statistic
FMM
Blog
Duplicates and appends a table row containing a placeholder.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
WordFile | 7.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameter | Description | Example |
---|---|---|
WordFile | The reference number of the open word file. | $wordFile |
Placeholder | The name of the placeholder. | "City" |
Returns OK or error.
Add two lines and remove template line:
# load from container
Set Variable [ $wordfile ; Value: MBS( "WordFile.OpenContainer"; WordFile::Input ) ]
If [ MBS("ISError") ]
Show Custom Dialog [ "Error" ; $wordFile ]
Exit Script [ Text Result: ]
End If
#
# add table row and fill in data
Set Variable [ $r ; Value: MBS( "WordFile.AppendTableRow"; $WordFile; "TName") ]
Set Variable [ $r ; Value: MBS( "WordFile.ReplaceTag"; $WordFile; "TName"; "Brochure 123") ]
Set Variable [ $r ; Value: MBS( "WordFile.ReplaceTag"; $WordFile; "TDescription"; "Restaurant Recommendations") ]
#
# add table row and fill in data
Set Variable [ $r ; Value: MBS( "WordFile.AppendTableRow"; $WordFile; "TName") ]
Set Variable [ $r ; Value: MBS( "WordFile.ReplaceTag"; $WordFile; "TName"; "Brochure 456") ]
Set Variable [ $r ; Value: MBS( "WordFile.ReplaceTag"; $WordFile; "TDescription"; "Hotel Recommendations") ]
#
# remove last row left
Set Variable [ $r ; Value: MBS( "WordFile.RemoveTableRow"; $WordFile; "TName") ]
#
# 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 26th January 2017, last changed 18th November 2021