Condividi tramite


XmlMappedRange.Offset Property

Gets a Range that is offset from the XmlMappedRange control.

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

Syntax

'Declaration
ReadOnly Property Offset As XmlMappedRange_OffsetType
XmlMappedRange_OffsetType Offset { get; }

Property Value

Type: Microsoft.Office.Tools.Excel.XmlMappedRange_OffsetType
A Range that is offset from the XmlMappedRange control.

Remarks

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

Parameter

Description

RowOffset

The number of rows (positive, negative, or 0 (zero)) by which the range is to be offset. Positive values are offset downward, and negative values are offset upward. The default value is 0.

ColumnOffset

The number of columns (positive, negative, or 0 (zero)) by which the range is to be offset. Positive values are offset to the right, and negative values are offset to the left. The default value is 0.

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

Optional Parameters

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

Examples

The following code example uses the Offset property to select a range that is offset from an XmlMappedRange by three cells to the right and three cells down. This code example assumes that the current worksheet contains an XmlMappedRange named CustomerLastNameCell.

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

.NET Framework Security

See Also

Reference

XmlMappedRange Interface

Microsoft.Office.Tools.Excel Namespace