AttachToDocument Method

Microsoft Word Visual Basic

AttachToDocument Method

Attaches an XML schema to a document.

expression.AttachToDocument(Document)

expression    Required. An expression that returns an XMLNamespace object.

Document    Required Document. The document to which to attach the specified XML schema.

Example

The following example adds the SimpleSample schema to the Schema Library and then attaches it to the active document.

    Dim objSchema As XMLNamespace
    
Set objSchema = Application.XMLNamespaces _
    .Add("c:\schemas\simplesample.xsd")

objSchema.AttachToDocument ActiveDocument
  

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.