Class XMLNamespace (Word VBA)
The class XMLNamespace represents an individual schema within the Schema Library. To use a XMLNamespace class variable it first needs to be instantiated, for example
Dim xml as XMLNamespace
Set xml = Application.XMLNamespaces(Index:=1)
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
Alias
Returns a String that represents the display name for the specified object.
Alias (AllUsers)
AttachToDocument
Attaches an XML schema to a document.
AttachToDocument (Document)
Document: The document to which to attach the specified XML schema.
Dim objSchema As XMLNamespace
Set objSchema = Application.XMLNamespaces _
.Add("c:\schemas\simplesample.xsd")
objSchema.AttachToDocument ActiveDocument
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.
DefaultTransform (AllUsers)
Delete
Deletes the specified XML schema from the list of available XML schemas.
Application.XMLNamespaces(1).Delete
Location
Returns or sets a String that represents the physical location of the namespace of an XML schema in the Schema Library.
Location (AllUsers)
AllUsers: Specifies whether to return the location for all users. False returns the location for only the current user, which may be different than the location for all users.
Application.XMLNamespaces(1).Location =
URI
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 objSchema As XMLNamespace
Dim objTransform As XSLTransform
Set objSchema = Application.XMLNamespaces("SimpleSample")
Set objTransform = objSchema.XSLTransforms _
.Add("c:\schemas\simplesample.xsl")