CustomXMLParts Object
Collapse the table of content
Expand the table of content

CustomXMLParts Object (Office)

Office 2013 and later

Contribute to this content

Use GitHub to suggest and submit changes. See our guidelines for contributing to VBA documentation.

Represents a collection of CustomXMLPart objects.

There are three default parts that are always created with a document. These are 'Cover pages', 'Doc properties' and 'App properties'. The last two were in previous versions of Microsoft Word but are now provided in XML form in the CustomXMLParts object collection

The following example adds a node to a CustomXMLPart object that is part of the CustomXMLParts object collection.

Sub AddPartToCollection() 
    Dim myPart As CustomXMLPart 
    Set myPart = ActiveDocument.CustomXMLParts.Add("<author>Mark Twain</author>") 
End Sub
© 2016 Microsoft