# Item Property (Errors Collection)

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

expression.Item(ByVal index As Long) As Error

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

index Required Long Integer. An expression that specifies the position of a member of the Errors collection. The argument must be a number from 0 to the value of the collection's Count property minus 1.

returns A reference to an Error object.

## Security Level

0: Can be accessed without restrictions.

## Remarks

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

After you have set a reference to the Error 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 Errors collection is used to return a reference to an Error object:

    var objError;
    objError = XDocument.Errors.Item(0);

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

    var objError;
    objError = XDocument.Errors(0);

©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