Skip to content

Latest commit

 

History

History
57 lines (34 loc) · 1.77 KB

Word.xmlnamespaces.add.md

File metadata and controls

57 lines (34 loc) · 1.77 KB
title keywords f1_keywords ms.assetid ms.date ms.localizationpriority
XMLNamespaces.Add method (Word)
vbawd10.chm248971365
vbawd10.chm248971365
2b70fb44-adf0-31e9-0528-bda1189b85f5
06/08/2017
medium

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 '' 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

[!includeSupport and feedback]