CustomXMLPrefixMappings.LookupPrefix Method (Office)

Allows you to get a prefix corresponding to the specified namespace.


expression. LookupPrefix( _NamespaceURI_ )

expression An expression that returns a CustomXMLPrefixMappings object.


Name Required/Optional Data type Description
NamespaceURI Required String Contains the namespace URI.

Return value



If no prefix is assigned to the requested namespace, the method returns an empty string (""). If there are multiple prefixes specified in the namespace manager, the method returns the first prefix that matches the supplied namespace.


The following example retrieves the namespace prefix associated with the namespace URI.

Dim objCustomPrefixMappings As  CustomPrefixMappings 
Dim strNamespacePrefix As String 
' Gets the namespace corresponding to the prefix. 
strNamespacePrefix = objCustomPrefixMappings.LookupPrefix("urn:invoice:namespace") 

See also

CustomXMLPrefixMappings Object

CustomXMLPrefixMappings Object Members