XmlMappedRange.Copy Method

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

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

Syntax

'Declaration
Function Copy ( _
    Destination As Object _
) As Object
Object Copy(
    Object Destination
)

Parameters

  • Destination
    Type: System.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.

Return Value

Type: System.Object

Remarks

Optional Parameters

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

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 Sub CopyAndPaste()
    Me.CustomerLastNameCell.Value2 = "Smith" 
    Me.CustomerLastNameCell.Copy()
    Me.CustomerFirstNameCell.PasteSpecial(Excel.XlPasteType.xlPasteValues, _
        Excel.XlPasteSpecialOperation.xlPasteSpecialOperationNone, False, False)
End Sub
private void CopyAndPaste()
{
    this.CustomerLastNameCell.Value2 = "Smith";
    this.CustomerLastNameCell.Copy();
    this.CustomerFirstNameCell.PasteSpecial(
        Excel.XlPasteType.xlPasteValues,
        Excel.XlPasteSpecialOperation.xlPasteSpecialOperationNone,
        false, false);
}

.NET Framework Security

See Also

Reference

XmlMappedRange Interface

Microsoft.Office.Tools.Excel Namespace