XmlMappedRange.PasteSpecial Method
Pastes the contents of a Range from the Clipboard into the XmlMappedRange control.
Namespace: Microsoft.Office.Tools.Excel
Assembly: Microsoft.Office.Tools.Excel (in Microsoft.Office.Tools.Excel.dll)
Syntax
'Declaration
Function PasteSpecial ( _
Paste As XlPasteType, _
Operation As XlPasteSpecialOperation, _
SkipBlanks As Object, _
Transpose As Object _
) As Object
Object PasteSpecial(
XlPasteType Paste,
XlPasteSpecialOperation Operation,
Object SkipBlanks,
Object Transpose
)
Parameters
Paste
Type: XlPasteTypeThe part of the range to be pasted.
Can be one of the following XlPasteType values:
Operation
Type: XlPasteSpecialOperationThe paste operation.
Can be one of the following XlPasteSpecialOperation values:
SkipBlanks
Type: System.Objecttrue to not have blank cells in the range on the Clipboard pasted into the destination range. The default value is false.
Transpose
Type: System.Objecttrue to transpose rows and columns when the range is pasted. The default value is false.
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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.