<div class="content" name="Item" uuid="d791ca4e-73cc-4330-92df-33e5fc54e070"><p>The Item method returns a pointer to the object at the
requested position in the collection of <b>Objects Being Enumerated</b>.</p><dl>
<dd>
<div><pre> [propget, id(DISPID_VALUE)] HRESULT Item(
   [in] long index,
   [out, retval] VARIANT* item
 );
</pre></div>
</dd></dl><p><b>index: </b>The position of the item in the
collection of <b>Objects Being Enumerated</b> to return.</p><p><b>item: </b>Pointer to a <a href="../ms-oaut/a6a540af-38ac-48be-bd40-92e2c01e9aa6" data-linktype="relative-path">VARIANT</a>
structure. Upon successful completion, receives the pointer to the <a href="../ms-oaut/ac9c502b-ac1c-4202-8ad4-048ac98afcc9" data-linktype="relative-path">IDispatch</a>
interface for the object.</p><p><b>Return Values: </b>The method MUST return zero on
success, or a nonzero error code on failure.</p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Return value/code</p>
   </th>
   <th>
   <p>Description</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>0x80004003 E_POINTER</td>
  <td>The item parameter is NULL.</td>
 </tr><tr>
  <td>0x80131502 COR_E_ARGUMENTOUTOFRANGE</td>
  <td>The value of the index parameter is greater than the number of Objects Being Enumerated in the collection.</td>
 </tr></tbody></table>
</dd></dl><p>Upon receiving this message, the server MUST validate
parameters:</p><ul><li><p><span><span> 
</span></span>Verify that <i>index</i> is not greater than the number of <b>Objects
Being Enumerated</b> in the collection.</p>
</li><li><p><span><span> 
</span></span>Verify that <i>item</i> is not NULL.</p>
</li></ul><p>If any validation fails, the server MUST terminate
processing and return a nonzero error code.</p><p>The server MUST set <i>item</i> to the IDispatch interface
of the corresponding object at the index location in the collection of <b>Objects
Being Enumerated</b>.</p></div>