WordFile.AppendTableRow
-----------------------

Duplicates and appends a table row containing a placeholder.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [WordFile](component_WordFile.md) | [7.1](newinversion71.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "WordFile.AppendTableRow"; WordFile; Placeholder ) 

**MBS**( **"WordFile.AppendTableRow";** /\* Duplicates and appends a table row containing a placeholder. \*/  
**$WordFile**; /\* The reference number of the open word file. \*/   
**$Placeholder**) /\* The name of the placeholder.e.g. "City" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| WordFile | The reference number of the open word file. | $wordFile |
| Placeholder | The name of the placeholder. | "City" |

### Result

Returns OK or error.

### Description

Duplicates and appends a table row containing a placeholder.  
If you have tables in your template word file and you like to duplicate rows and add them to the end of the table, just call this function with a placeholder field in that row. The place holder in the document must start with « and end with » characters.   
  
Use WordFile.AppendTableRow to add new row to the end or [WordFile.DuplicateTableRow](WordFileDuplicateTableRow.md) to add it after the referenced one.  
### Examples

Add two lines and remove template line:

 # load from container   
Set Variable \[ $wordfile ; Value: MBS ( "[WordFile.OpenContainer](WordFileOpenContainer.md)"; 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](WordFileReplaceTag.md)"; $WordFile ; "TName"; "Brochure 123") \]   
Set Variable \[ $r ; Value: MBS ( "[WordFile.ReplaceTag](WordFileReplaceTag.md)"; $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](WordFileReplaceTag.md)"; $WordFile ; "TName"; "Brochure 456") \]   
Set Variable \[ $r ; Value: MBS ( "[WordFile.ReplaceTag](WordFileReplaceTag.md)"; $WordFile ; "TDescription"; "Hotel Recommendations") \]   
\#   
\# remove last row left   
Set Variable \[ $r ; Value: MBS ( "[WordFile.RemoveTableRow](WordFileRemoveTableRow.md)"; $WordFile ; "TName") \]   
\#   
\# write to desktop   
Set Variable \[ $DesktopPath ; Value: MBS ("[Folders.UserDesktop](FoldersUserDesktop.md)") \]   
Set Variable \[ $FilePath ; Value: MBS ( "[Path.AddPathComponent](PathAddPathComponent.md)"; $DesktopPath ; "test output.docx" ) \]   
Set Variable \[ $r ; Value: MBS ( "[WordFile.WriteFile](WordFileWriteFile.md)"; $WordFile ; $FilePath ) \]   
Set Variable \[ $r ; Value: MBS ( "[Files.LaunchFile](FilesLaunchFile.md)"; $FilePath ) \]   
\# clean up   
Set Variable \[ $r ; Value: MBS ("[WordFile.Release](WordFileRelease.md)"; $WordFile ) \]  
### See also

- [Files.Launch](FilesLaunch.md)
- [Files.LaunchFile](FilesLaunchFile.md)
- [Folders.UserDesktop](FoldersUserDesktop.md)
- [IsError](IsError.md)
- [Path.AddPathComponent](PathAddPathComponent.md)
- [WordFile.Append](WordFileAppend.md)
- [WordFile.DuplicateTableRow](WordFileDuplicateTableRow.md)
- [WordFile.OpenContainer](WordFileOpenContainer.md)
- [WordFile.RemoveTableRow](WordFileRemoveTableRow.md)
- [WordFile.ReplaceTag](WordFileReplaceTag.md)

### Release notes

- **Version 7.1**
    - Added [WordFile.AppendTableRow](http://www.mbsplugins.eu/WordFileAppendTableRow.shtml) and [WordFile.DuplicateTableRow](http://www.mbsplugins.eu/WordFileDuplicateTableRow.shtml).

### Example Databases

- [WordFile/WordFile](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/WordFile/WordFile.shtml#1ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Plugin, version 7.1pr1](https://www.mbsplugins.de/archive/2017-02-04/MBS_FileMaker_Plugin_version_7/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

- [Ausgabe 6/2021, Seite 20](https://filemaker-magazin.de/neuigkeit/4165-Appetithappen-FMM_202106)

This function checks for a license.

Created 26th January 2017 , last changed 18th November 2021

  
[WordFile.Append](WordFileAppend.md) - [WordFile.Contains](WordFileContains.md)

[HTML Version](WordFileAppendTableRow.shtml)