Parameters
- document
Type: document
The document to locate in the DocumentCollection.
Return Value
Type: System.Int32
The zero-based index of the first occurrence of item within the entire DocumentCollection, if found; otherwise, –1.
| Exception | Description |
|---|---|
| ArgumentOutOfRangeException | index is less than 0 or index is greater than Count. |
The DocumentCollection is searched forward starting at index and ending at the last element.
The following code example demonstrates uses of the IndexOf method.
| C# | Copy Code |
|---|---|
// get main document Document doc = tab.MainDocument; // get index of main document in document collection of current web page int index = docCol.IndexOf(doc); | |
| PHP | Copy Code |
|---|---|
// get main document $doc = $tab->MainDocument; // get index of main document in document collection of current web page $index = $docCol->IndexOf($doc); | |
Target Platforms: Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family