Table of contents
Collapse the table of content
Expand the table of content

CustomXMLPrefixMappings.AddNamespace Method (Office)

office 365 dev account|Last Updated: 6/12/2017
1 Contributor

Allows you to add a custom namespace/prefix mapping to use when querying an item.


expression. AddNamespace( Prefix, NamespaceURI )

expression An expression that returns a CustomXMLPrefixMappings object.


NameRequired/OptionalData TypeDescription
PrefixRequiredStringContains the prefix to add to the prefix mapping list.
NamespaceURIRequiredStringContains the namespace to assign to the newly added prefix.


If the prefix already exists in the Namespace Manager, this method will overwrite the meaning of that prefix except when the prefix is one added or used by the data store ( IXMLDataStore interface) internally, in which case it will return an error.


The following example adds a prefix and namespace to a CustomPrefixMappings object.

Sub AddNamespacePrefix() 

    Dim objCustomPrefixMappings As  CustomPrefixMappings 
    Dim varCustomMapping As Variant 

    ' Adds a custom namespace. 
    varCustomMapping = objCustomPrefixMappings.AddNamespace("xs", "urn:invoice:namespace")      

End Sub

See also


CustomXMLPrefixMappings Object

Other resources

CustomXMLPrefixMappings Object Members

© 2018 Microsoft