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

Note
References to DTDs from custom XML parts are not supported. DTD references in custom XML parts will not resolve, and custom XML parts containing DTD references generate an exception when an attempt is made to save the file's content to a flat XML file.

Syntax

expression.LookupPrefix(NamespaceURI)

expression An expression that returns a CustomXMLPrefixMappings object.

Parameters

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

Return Value
String

Remarks

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.

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

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

See also: