XDocuments2.Item[Object] Property

Definition

Gets a reference to the specified XDocument object from the collection.

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

Parameters

varIndex
Object

An expression that specifies the position of a member of the XDocumentsCollection. If a numeric expression, the argument must be a number from 0 to the value of the Count minus 1. If a string expression, the argument must be the Uniform Resource Locator (URL) path of a member of the collection.

Property Value

Implements

Examples

Because the Item property is the default property of the XDocumentsCollection collection, it can be used as follows:

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

You can use the name of the XDocument as the argument to the Item method, as shown in the following example:

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

Remarks

If the value provided for the varIndex argument does not match any existing member of the collection, an error occurs.

After you have set a reference to the XDocument object that the Item property returns, you can access any of its properties or methods.

Important: This member can be accessed without restrictions.

Applies to