Partager via


_CustomXMLSchemaCollection.Add Method

Allows you to add one or more schemas to a schema collection that can then be added to a stream in the data store and to the Schema Library.

Namespace:  Microsoft.Office.Core
Assembly:  office (in office.dll)

Syntax

'Declaration
Function Add ( _
    NamespaceURI As String, _
    Alias As String, _
    FileName As String, _
    InstallForAllUsers As Boolean _
) As CustomXMLSchema
'Usage
Dim instance As _CustomXMLSchemaCollection
Dim NamespaceURI As String
Dim Alias As String
Dim FileName As String
Dim InstallForAllUsers As Boolean
Dim returnValue As CustomXMLSchema

returnValue = instance.Add(NamespaceURI, _
    Alias, FileName, InstallForAllUsers)
CustomXMLSchema Add(
    string NamespaceURI,
    string Alias,
    string FileName,
    bool InstallForAllUsers
)

Parameters

  • NamespaceURI
    Type: System.String

    Optional String. Contains the namespace of the schema to be added to the collection. If the schema already exists in the Schema Library, the method will retrieve it from there.

  • Alias
    Type: System.String

    Optional String. Contains the alias of the schema to be added to the collection. If the alias already exists in the Schema Library, the method can find it using this argument.

  • FileName
    Type: System.String

    Optional String. Contains the location of the schema on a disk. If this parameter is specified, the schema is added to the collection and to the Schema Library.

  • InstallForAllUsers
    Type: System.Boolean

    Optional Boolean. Specifies whether, in the case where the method is adding the schema to the Schema Library, the Schema Library keys should be written to the registry(HKey_Local_Machine for all users or HKey_Current_User for just the current user). The parameter defaults to False and writes to HKey_Current_User.

Return Value

Type: Microsoft.Office.Core.CustomXMLSchema
CustomXMLSchema

Remarks

Note

References to DTDs from custom XML parts are not supported. DTD references in custom XML parts will not resolve, and custom XML parts containing DTD references generate an exception when an attempt is made to save the file's content to a flat XML file.

See Also

Reference

_CustomXMLSchemaCollection Interface

_CustomXMLSchemaCollection Members

Microsoft.Office.Core Namespace