CustomXMLSchemaCollection.AddCollection 方法 (Office)

将现有的架构集合添加到当前架构集合。

语法

表达式AddCollection (SchemaCollection)

表达 返回 CustomXMLSchemaCollection 对象的表达式。

参数

名称 必需/可选 数据类型 说明
SchemaCollection 必需 CustomXMLSchemaCollection 代表要导入到当前架构集合中的架构集合。

备注

如果在导入集合时命名空间之间存在冲突(例如,如果已将 x.xsd 链接到“urn:invoice:namespace”,但是传入的集合具有同一命名空间的 z.xsd),则优先采用传入的集合。

示例

以下示例接收目标架构集合和传入架构集合的参数,然后将一个集合添加到另一个集合。

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

另请参阅

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。