XMLNamespace object (Word)
Represents an individual schema within the Schema Library.
Remarks
You can access the Schema Library from within Microsoft Word 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 using the URI property (the TargetNamespace setting defined in the schema).
The following example attaches a schema named SimpleSample to the active document.
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
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
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for