CustomXMLSchemaCollection.AddCollection method (Office)

Adds an existing schema collection to the current schema collection.

Syntax

expression.AddCollection(SchemaCollection)

expression An expression that returns a CustomXMLSchemaCollection object.

Parameters

Name Required/Optional Data type Description
SchemaCollection Required CustomXMLSchemaCollection Represents a collection of schemas to be imported into the current schema collection.

Remarks

If there is a conflict between namespaces while importing the collection, for example if x.xsd is already linked to "urn:invoice:namespace" but the incoming collection has z.xsd for the same namespace, the incoming collection wins.

Example

The following example receives the target schema collection and incoming schema collection arguments and then adds the one collection to the other.

Sub AddSchema(objTargetCustomXMLSchemaCollection As CustomXMLSchemaCollection, _ 
  objTargetCustomXMLSchemaCollection As CustomXMLSchemaCollection) 
 
    ' Adds a schema collection to another schema the collection. 
    objTargetCustomXMLSchemaCollection.AddCollection(objIncomingCustomXMLSchemaCollection) 
                
End Sub

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.