Share via


XMLNamespaces.Add Method (Word)

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

Syntax

expression .Add(Path, NamespaceURI, Alias, InstallForAllUsers)

expression Required. A variable that represents a XMLNamespaces collection.

Parameters

Name

Required/Optional

Data Type

Description

Path

Required

String

The path and file name of the schema. This may be a local file path, a network path, or an Internet address.

NamespaceURI

Optional

String

The namespace Uniform Resource Indicator as specified in the schema. The NamespaceURI parameter is case-sensitive and must be spelled exactly as specified in schema.

Alias

Optional

String

The name of the schema as it appears on the Schemas tab in the Templates and Add-ins dialog box.

InstallForAllUsers

Optional

Boolean

True if all users that log on to a computer can access and use the new schema. The default is False.

Return Value

XMLNamespace

Example

The following example adds the specified schema to the Schema Library and then attaches it to the active document. This example assumes that you have a schema named simplesample.xsd at the specified path.

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

See Also

Concepts

XMLNamespaces Object Members

XMLNamespaces Collection