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.2   12.3   12.4   12.5   13.0   13.1   13.2   13.3   13.4   13.5    Statistic    FMM    Blog  

WordFile.WriteContainer

Writes a file to container.

Component Version macOS Windows Linux Server iOS SDK
WordFile 11.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "WordFile.WriteContainer"; WordFile; FileName )   More

Parameters

Parameter Description Example
WordFile The reference number of the open word file. $wordFile
FileName The file name to use for the container. "test.docx"

Result

Returns container value or error.

Description

Writes a file to container.
Please pass file name as parameter and the extension should be correct, either docx or xml depending on what you loaded.
May break if newer versions of Microsoft Word or Office change the docx file format.

Examples

Substitute a text in word file:

# load it
Set Variable [ $Wordfile ; Value: MBS( "WordFile.OpenContainer"; myTable::InputWordFile ) ]
# replace something
Set Variable [ $r ; Value: MBS( "WordFile.Substitute"; $Wordfile; $SearchWord; $ReplaceWord ]
# write it
Set Field [ myTable::OutputWordFile ; Value: MBS( "WordFile.WriteContainer"; $Wordfile; "Test.docx" ) ]
# release memory
Set Variable [ $r ; Value: MBS("WordFile.Release"; $Wordfile) ]

See also

Release notes

Blog Entries

This function checks for a license.

Created 24th July 2021, last changed 8th September 2021


WordFile.Texts - WordFile.WriteFile

💬 Ask a question or report a problem