Show All

# Item Property (DataObjects Collection)

A read-only property that returns a reference to the specified DataObject object from the DataObjects collection.

expression.Item(ByVal varIndex As Variant) As DataObject

expression Required. An expression that returns a reference to the DataObjects collection.

varIndex Required Variant. An expression that specifies the position of a member of the DataObjects 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 name of a member of the collection.

returns A reference to a DataObject object.

## Security Level

2: Can be accessed only by forms running in the same domain as the currently open form, or by forms that have been granted cross-domain permissions.

## 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 DataObject object that the Item property returns, you can access any of its properties or methods.

## Example

In the following example, the Item property of the DataObjects collection is used to return a reference to a DataObject object:

    var objDataObject;
    objDataObject = XDocument.DataObjects.Item(0);

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

    var objDataObject;
    objDataObject = XDocument.DataObjects(0);

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

    var objDataObject;
    objDataObject = XDocument.DataObjects("MyDataObject");

©2003-2004 Microsoft Corporation. All rights reserved. Permission to copy, display and distribute this document is available at: http://msdn.microsoft.com/library/en-us/odcXMLRef/html/odcXMLRefLegalNotice.asp