XmlMappedRange.Insert Method (Object, Object)

 

Inserts a cell into the XmlMappedRange control and shifts other cells away to make space.

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

object Insert(
	object Shift,
	object CopyOrigin
)

Parameters

Shift
Type: System.Object

Specifies which way to shift the cells. Can be one of the following T:Microsoft.Office.Interop.Excel.XlInsertShiftDirection values: F:Microsoft.Office.Interop.Excel.XlInsertShiftDirection.xlShiftToRight or F:Microsoft.Office.Interop.Excel.XlInsertShiftDirection.xlShiftDown. If this argument is omitted, Microsoft Office Excel selects a value.

CopyOrigin
Type: System.Object

The copy origin.

Return Value

Type: System.Object

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

The following code example uses the Insert method to insert a cell above an XmlMappedRange. This code example assumes that the current worksheet contains an XmlMappedRange named CustomerLastNameCell.

private void InsertAbove()
{
    this.CustomerLastNameCell.Insert(
        Excel.XlInsertShiftDirection.xlShiftDown);
}
Return to top
Show: