Skip to content

Latest commit

 

History

History
66 lines (41 loc) · 1.41 KB

Office.CustomXMLPart.LoadXML.md

File metadata and controls

66 lines (41 loc) · 1.41 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
CustomXMLPart.LoadXML method (Office)
vbaof11.chm295011
vbaof11.chm295011
Office.CustomXMLPart.LoadXML
efdbb098-48ec-1c64-9d9d-b0a64a5c3753
01/07/2019
medium

CustomXMLPart.LoadXML method (Office)

Allows the template author to populate a CustomXMLPart object from an XML string. Returns True if the load was successful.

Syntax

expression.LoadXML(XML)

expression An expression that returns a CustomXMLPart object.

Parameters

Name Required/Optional Data type Description
XML Required String Contains the XML to load.

Return value

Boolean

Example

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

See also

[!includeSupport and feedback]