Share via


DataObjects.Item Property

Gets a reference to the specified DataSourceObject object from the DataObjectsCollection collection.

Namespace:  Microsoft.Office.Interop.InfoPath.SemiTrust
Assembly:  Microsoft.Office.Interop.InfoPath.SemiTrust (in Microsoft.Office.Interop.InfoPath.SemiTrust.dll)

Syntax

'Declaration
ReadOnly Default Property Item ( _
    varIndex As Object _
) As DataObject
    Get
'Usage
Dim instance As DataObjects
Dim varIndex As Object
Dim value As DataObject

value = instance(varIndex)
DataObject this[
    Object varIndex
] { get; }

Parameters

  • varIndex
    Type: System.Object

    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 Count property minus 1. If a string expression, the argument must be the name of a member of the collection.

Property Value

Type: Microsoft.Office.Interop.InfoPath.SemiTrust.DataObject

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

Important

This member 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.

Examples

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

DataObject myDataObject = thisXDocument.DataObjects[i];

See Also

Reference

DataObjects Interface

DataObjects Members

Microsoft.Office.Interop.InfoPath.SemiTrust Namespace