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:
9.5
10.0
10.1
10.2
10.3
10.4
10.5
11.0
11.1
11.2
Statistic
FMM
Blog
Duplicates 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) ]
Created 26th January 2017, last changed 30th September 2019
WordFile.Append - WordFile.DuplicateTableRow
Feedback: Report problem or ask question.