WordFile.SetXML
---------------

Sets the xml for this word file.

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

MBS( "WordFile.SetXML"; WordFile; XML { ; Part } ) 

**MBS**( **"WordFile.SetXML";** /\* Sets the xml for this word file. \*/  
**$WordFile**; /\* The reference number of the open word file. \*/   
**$XML**; /\* The XML content for the word file. \*/   
**$Part**) /\* Optional; The name of the part to query.  
See [WordFile.Parts](WordFileParts.md) for a list of parts.  
if no part is given, we use the document.e.g. "document" \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| WordFile | The reference number of the open word file. | $wordFile |  |
| XML | The XML content for the word file. |  |  |
| Part | The name of the part to query.   See [WordFile.Parts](WordFileParts.md) for a list of parts.   if no part is given, we use the document. | "document" | Optional |

### Result

Returns OK or error.

### Description

Sets the xml for this word file.  
### Examples

Change XML directly:

 # get xml   
Set Variable \[ $xml ; Value: MBS ( "[WordFile.GetXML](WordFileGetXML.md)"; $wordfile ) \]   
\# Change something   
Set Variable \[ $xml ; Value: Substitute($xml ; "Times New Roman"; "Helvetica") \]   
\# put xml back   
Set Variable \[ $r ; Value: MBS ( "WordFile.SetXML"; $wordfile ; $xml ) \]  
### See also

- [WordFile.GetXML](WordFileGetXML.md)
- [WordFile.Parts](WordFileParts.md)

### Blog Entries

- [MBS FileMaker Plugin, version 6.2pr1](https://www.mbsplugins.de/archive/2016-03-19/MBS_FileMaker_Plugin_version_6/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 15th March 2016 , last changed 29th December 2021

  
[WordFile.SetSkipDeletedText](WordFileSetSkipDeletedText.md) - [WordFile.Substitute](WordFileSubstitute.md)

[HTML Version](WordFileSetXML.shtml)