title | keywords | f1_keywords | api_name | ms.assetid | ms.date | ms.localizationpriority | ||
---|---|---|---|---|---|---|---|---|
CustomXMLPart.LoadXML method (Office) |
vbaof11.chm295011 |
|
|
efdbb098-48ec-1c64-9d9d-b0a64a5c3753 |
01/07/2019 |
medium |
Allows the template author to populate a CustomXMLPart object from an XML string. Returns True if the load was successful.
expression.LoadXML(XML)
expression An expression that returns a CustomXMLPart object.
Name | Required/Optional | Data type | Description |
---|---|---|---|
XML | Required | String | Contains the XML to load. |
Boolean
The following example loads XML into a custom XML part from a string.
Sub ShowCustomXmlParts()
On Error GoTo Err
Dim cxp1 As CustomXMLPart
' Add a custom XML part and then load the XML.
Set cxp1 = ActiveDocument.CustomXMLParts.Add
cxp1.LoadXML("<discounts><discount>0.10</discount></discounts>")
Exit Sub
' Exception handling. Show the message and resume.
Err:
MsgBox (Err.Description)
Resume Next
End Sub
[!includeSupport and feedback]