XDocuments2.Item[Object] 属性

定义

从集合中获取对指定 XDocument 对象的引用。

public:
 property Microsoft::Office::Interop::InfoPath::SemiTrust::XDocument ^ default[System::Object ^] { Microsoft::Office::Interop::InfoPath::SemiTrust::XDocument ^ get(System::Object ^ varIndex); };
public Microsoft.Office.Interop.InfoPath.SemiTrust.XDocument this[object varIndex] { get; }
member this.Item(obj) : Microsoft.Office.Interop.InfoPath.SemiTrust.XDocument
Default Public ReadOnly Property Item(varIndex As Object) As XDocument

参数

varIndex
Object

一个指定 成员的位置的 XDocumentsCollection表达式。 如果是数值表达式,则参数必须是从 0 到减 1 的值的数字 Count 。 如果是字符串表达式,该参数必须为该集合成员的统一资源定位器 (URL) 路径。

属性值

实现

示例

由于 Item 属性是集合的默认属性 XDocumentsCollection ,因此可按如下所示使用:

XDocument firstDocument;
firstDocument = thisApplication.XDocuments[0];

可以将 XDocument 的名称用作 Item 方法的参数,如以下示例所示:

XDocument myFormDocument;
myFormDocument = thisApplication.XDocuments[@"C:\MyForm.xml"];

注解

如果为 varIndex 参数提供的值与集合的任何现有成员都不匹配,则会发生错误。

在设置了对 Item 属性返回的 XDocument 对象的引用之后,可以访问其任何属性或方法。

重要说明:可以不受限制地访问此成员。

适用于