Freigeben über


XmlMappedRange.Copy(Object) Method

Definition

Copies the contents of the XmlMappedRange control to the specified range or to the Clipboard.

public object Copy (object Destination);
abstract member Copy : obj -> obj
Public Function Copy (Optional Destination As Object) As Object

Parameters

Destination
Object

Specifies the new range to which the XmlMappedRange control is copied. If this argument is omitted, Microsoft Office Excel copies the range to the Clipboard.

Returns

Examples

The following code example uses the Copy method to copy an XmlMappedRange to the Clipboard, and then uses the PasteSpecial method to copy the range to a different XmlMappedRange. This code example assumes that the current worksheet contains two XmlMappedRange controls named CustomerFirstNameCell and CustomerLastNameCell.

private void CopyAndPaste()
{
    this.CustomerLastNameCell.Value2 = "Smith";
    this.CustomerLastNameCell.Copy();
    this.CustomerFirstNameCell.PasteSpecial(
        Excel.XlPasteType.xlPasteValues,
        Excel.XlPasteSpecialOperation.xlPasteSpecialOperationNone,
        false, false);
}
Private Sub CopyAndPaste()
    Me.CustomerLastNameCell.Value2 = "Smith"
    Me.CustomerLastNameCell.Copy()
    Me.CustomerFirstNameCell.PasteSpecial(Excel.XlPasteType.xlPasteValues, _
        Excel.XlPasteSpecialOperation.xlPasteSpecialOperationNone, False, False)
End Sub

Remarks

Optional Parameters

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

Applies to