XmlFormCollection.Item Property

Gets a reference to the specified XmlForm object from the collection by index value.

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

Syntax

'Declaration
Public MustOverride ReadOnly Default Property Item ( _
    index As Integer _
) As XmlForm
    Get
'Usage
Dim instance As XmlFormCollection
Dim index As Integer
Dim value As XmlForm

value = instance(index)
public abstract XmlForm this[
    int index
] { get; }

Parameters

  • index
    Type: System.Int32

    The zero-based index of the form to return.

Property Value

Type: Microsoft.Office.InfoPath.XmlForm
The XmlForm object for the specified index value.

Exceptions

Exception Condition
IndexOutOfRangeException

The index provided is out of range.

Remarks

If the value that is provided for the index parameter does not match any existing member of the collection, an exception is raised.

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

This member can be accessed without restrictions.

This type or member can be accessed only from code running in forms opened in Microsoft InfoPath Filler.

Examples

Because the Item property is the default property of the XmlFormCollection class, it can be used as shown in the following code example.

XmlForm firstForm = this.Application.XmlForms[0];
Dim firstForm As XmlForm  = Me.Application.XmlForms(0)

See Also

Reference

XmlFormCollection Class

XmlFormCollection Members

Microsoft.Office.InfoPath Namespace