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.3
9.4
9.5
10.0
10.1
10.2
10.3
10.4
10.5
10.6
Statistic
FMM
Blog
WordFile.GetXML
Queries xml content of the word file.
| Component | Version | macOS | Windows | Linux | Server | FileMaker iOS SDK |
| WordFile | 6.2 | Yes | Yes | Yes | Yes | Yes |
Parameters
| Parameter | Description | Example | Flags |
|---|---|---|---|
| WordFile | The reference number of the open word file. | $wordFile | |
| Part | The name of the part to query. See WordFile.Parts for a list of parts. if no part is given, we use the document. |
"document" | Optional |
Result
Returns xml text or error.
Description
Queries xml content of the word file.Getting the raw xml allows you to make modification yourself like adding paragraphs or a table.
Examples
Query XML of first footer:
MBS( "WordFile.GetXML"; $wordFile; "footer1" )
Query document relations:
MBS( "WordFile.GetXML"; $WordFile; "document.xml.rels")
Query custom properties of a word file:
# open word file
Set Variable [ $wordfile ; Value: MBS( "WordFile.OpenContainer"; WordFile::Input ) ]
If [ MBS("ISError") ]
Show Custom Dialog [ "Error" ; $wordFile ]
Exit Script [ Text Result: ]
End If
#
# read xml
Set Variable [ $xml ; Value: MBS( "WordFile.GetXML"; $WordFile; "custom") ]
#
# get property count
Set Variable [ $count ; Value: MBS( "XML.NodeCount"; $xml; "property" ) ]
#
If [ $count > 0 ]
Set Variable [ $i ; Value: 0 ]
#
Loop
Set Variable [ $name ; Value: MBS( "XML.GetPathValue"; $xml; "Properties.property[" & $i & "]#name"; 1+2 ) ]
Set Variable [ $value ; Value: MBS( "XML.GetPathValue"; $xml; "Properties.property[" & $i & "].lpwstr"; 1+2 ) ]
#
Show Custom Dialog [ "Custom propety" ; $name & ": " & $value ]
#
Set Variable [ $i ; Value: $i + 1 ]
Exit Loop If [ $i >= $count ]
End Loop
#
#
End If
#
# free memory
Set Variable [ $r ; Value: MBS( "WordFile.Release"; $WordFile) ]
See also
- IsError
- WordFile.OpenContainer
- WordFile.Parts
- WordFile.Release
- WordFile.ReplaceTag
- WordFile.SetXML
- XML.GetPathValue
- XML.NodeCount
Blog Entries
Release notes
- Version 9.5
- Improved WordFile.GetXML function to work with rels parts in the Word file.
Created 15th March 2016, last changed 6th December 2020
WordFile.GetMediaFile - WordFile.HasTag
Feedback: Report problem or ask question.
Links
MBS Xojo Plugins