Class XMLNamespace (Word VBA)

The class XMLNamespace represents an individual schema within the Schema Library.

The main procedures of class XMLNamespace are Delete and XMLNamespaces.Add


To use a XMLNamespace class variable it first needs to be instantiated, for example

Dim xml as XMLNamespace
Set xml = Application.XMLNamespaces(Index:=1)

The following procedures can be used to set variables of type XMLNamespace: XMLNamespaces.Add, XMLNamespaces.Item and Application.XMLNamespaces

For Each

Here is an example of processing the XMLNamespace items in a collection.

Dim xml As XMLNamespace
For Each xml In Application.XMLNamespaces
Next xml


These are the main methods of the XMLNamespace class

Delete - Deletes the specified XML schema from the list of available XML schemas.


XMLNamespaces.Add - Returns an XMLNamespace object that represents a schema that is added to the Schema Library and made available to users in Microsoft Word.

Dim strPath As String: strPath =  
Dim xml As XMLNamespace
Set xml = Application.XMLNamespaces.Add(Path:=strPath)

Other Methods

XMLNamespaces.InstallManifest - Installs the specified XML expansion pack on the user's computer, making an XML smart document solution available to one or more users.

Dim strPath As String: strPath =  
Application.XMLNamespaces.InstallManifest Path:=strPath


Alias returns a String that represents the display name for the specified object.

Application.XMLNamespaces(1).Alias =

DefaultTransform returns an XSLTransform object that represents the default Extensible Stylesheet Language Transformation (XSLT) file to use when opening a document from an XML schema for a particular namespace.

Application.XMLNamespaces(1).DefaultTransform =

Location returns or sets a String that represents the physical location of the namespace of an XML schema in the Schema Library.

Application.XMLNamespaces(1).Location =

Parent returns an object that represents the parent object of the specified XMLNamespace object.

Dim objParent As Object
Set objParent = Application.XMLNamespaces(1).Parent


Dim strURI As String
strURI = Application.XMLNamespaces(1).URI

XSLTransforms returns an XSLTransforms collection that represents the Extensible Stylesheet Language Transformation (XSLT) files specified for use with a schema.

Dim xslsXSLTransforms As XSLTransforms
Set xslsXSLTransforms = Application.XMLNamespaces(1).XSLTransforms

XMLNamespaces.Count returns a Long that represents the number of XML namespaces in the collection.

Dim lngCount As Long
lngCount = Application.XMLNamespaces.Count

XMLNamespaces.Parent returns an object that represents the parent object of the specified XMLNamespaces object.

Dim objParent As Object
Set objParent = Application.XMLNamespaces.Parent