Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

XDocuments.Item Property

Office 2007
A read-only property that returns a reference to the specified XDocument object from the XDocuments collection. Read-only

Version Information
 Version Added:  InfoPath 2003

Syntax

expression.Item(varIndex)

expression   An expression that returns a XDocuments object.

Parameters

NameRequired/OptionalData TypeDescription
varIndexRequiredVariantAn expression that specifies the position of a member of the XDocuments collection. If a numeric expression, the argument must be a number from 0 to the value of the collection's Count property minus 1. If a string expression, the argument must be the Uniform Resource Locator (URL) path of a member of the collection.

Return Value
XDocument

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.

Security Level 0: Can be accessed without restrictions.

Example

In the following example, the Item property of the XDocuments collection is used to return a reference to an XDocument object:

JScript
var objXDoc;
objXDoc = Application.XDocuments.Item(0);

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

JScript
var objXDoc;
objXDoc = Application.XDocuments(0);

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

JScript
var objXDoc;
objXDoc = Application.XDocuments("MyForm");



Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.