共用方式為


XmlMappedRange.Item Property

Gets a Range that represents a range at an offset to the XmlMappedRange control.

Namespace:  Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel (in Microsoft.Office.Tools.Excel.dll)

Syntax

'Declaration
ReadOnly Property Item As XmlMappedRange_ItemType
XmlMappedRange_ItemType Item { get; }

Property Value

Type: Microsoft.Office.Tools.Excel.XmlMappedRange_ItemType
A Range that represents a range at an offset to the XmlMappedRange control.

Remarks

The Item property is intended to be used with the following parameters.

Parameter

Description

RowIndex

The index number of the cell you want to access, in order from left to right.

ColumnIndex

A number or string that indicates the column number of the cell you want to access, starting with either 1 or "A" for the first column in the range.

If you attempt to use Item without specifying any parameters, Item will get an XmlMappedRange_ItemType object that is part of the Office development tools in Visual Studio infrastructure and is not intended to be used directly from your code.

The RowIndex and ColumnIndex arguments are relative offsets. In other words, specifying a RowIndex of 1 returns cells in the first row of the range, not the first row of the worksheet.

Optional Parameters

For information on optional parameters, see Optional Parameters in Office Solutions.

Examples

The following code example uses the Item property to select the cell that is offset from an XmlMappedRange by three columns and three rows. This code example assumes that the current worksheet contains an XmlMappedRange named CustomerLastNameCell.

Private Sub SelectItem()
    Dim offsetCell As Excel.Range = _
        CType(Me.CustomerLastNameCell.Item(3, 3), Excel.Range)
    offsetCell.Value2 = "Offset cell." 
    offsetCell.Select()
End Sub
private void SelectItem()
{
    Excel.Range offsetCell = 
        (Excel.Range)this.CustomerLastNameCell.Item[3, 3];
    offsetCell.Value2 = "Offset cell.";
    offsetCell.Select();
}

.NET Framework Security

See Also

Reference

XmlMappedRange Interface

Microsoft.Office.Tools.Excel Namespace