Share via


XMLNamespaces Collection

Word Developer Reference

A collection of XMLNamespace objects that represents the entire collection of schemas in the Schema Library.

Remarks

In Microsoft OfficeWord, you can access the Schema Library from the XML Schema tab in the Templates and Add-ins dialog box. The Schema Library represents schemas installed on a user's computer that a user has applied to a Word document or that a user has explicitly added to the Schema Library by using the Schema Library dialog box.

Use the Item method of the XMLNamespaces collection to return an individual XMLNameSpace object. The index value of the Item method can be either a Long, which indicates the position of the schema in the Schema Library, or a String, which represents the name of the schema as returned by using the URI property (the TargetNamespace setting defined in the schema).

The following example attaches a schema named SimpleSample to the active document.

Visual Basic for Applications
  Sub ApplySampleSchema()
    Dim objSchema As XMLNamespace
    
    For Each objSchema In Application.XMLNamespaces
        If objSchema.URI = "SimpleSample" Then
            objSchema.AttachToDocument ActiveDocument
            Exit For
        End If
    Next
End Sub
Bb179168.vs_note(en-us,office.12).gif  Note
The SimpleSample schema is included in the Smart Document Software Development Kit (SDK). For more information, refer to the Smart Document SDK on the Microsoft Developer Network (MSDN) Web site.

See Also