Partager via


XmlMappedRange.Offset Property

Definition

Gets a Range that is offset from the XmlMappedRange control.

public:
 property Microsoft::Office::Tools::Excel::XmlMappedRange_OffsetType ^ Offset { Microsoft::Office::Tools::Excel::XmlMappedRange_OffsetType ^ get(); };
public Microsoft.Office.Tools.Excel.XmlMappedRange_OffsetType Offset { get; }
member this.Offset : Microsoft.Office.Tools.Excel.XmlMappedRange_OffsetType
Public ReadOnly Property Offset As XmlMappedRange_OffsetType

Property Value

A Range that is offset from the XmlMappedRange control.

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 void ActivateOffset()
{
    Excel.Range offsetRange = 
        (Excel.Range)this.CustomerLastNameCell.Offset[3, 3];
    offsetRange.Value2 = "Offset range.";
    offsetRange.Select();
}
Private Sub ActivateOffset()
    Dim offsetRange As Excel.Range = _
        CType(Me.CustomerLastNameCell.Offset(3, 3), Excel.Range)
    offsetRange.Value2 = "Offset range."
    offsetRange.Select()
End Sub

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.

Applies to