Export (0) Print
Expand All
Expand Minimize

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)

XmlMappedRange_OffsetType Offset { get; }

Property Value

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

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.

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 void ActivateOffset()
{
    Excel.Range offsetRange = 
        (Excel.Range)this.CustomerLastNameCell.Offset[3, 3];
    offsetRange.Value2 = "Offset range.";
    offsetRange.Select();
}

Show:
© 2015 Microsoft