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: Microsoft.Office.Interop.Excel.XlPasteType
The part of the range to be pasted.
Can be one of the following XlPasteType values:
xlPasteAll
xlPasteAllExceptBorders
xlPasteColumnWidths
xlPasteComments
xlPasteFormats
xlPasteFormulas
xlPasteFormulasAndNumberFormats
xlPasteValidation
xlPasteValues
xlPasteValuesAndNumberFormats
- Operation
Type: Microsoft.Office.Interop.Excel.XlPasteSpecialOperation
The paste operation.
Can be one of the following XlPasteSpecialOperation values:
xlPasteSpecialOperationAdd
xlPasteSpecialOperationDivide
xlPasteSpecialOperationMultiply
xlPasteSpecialOperationNone
xlPasteSpecialOperationSubtract
- SkipBlanks
Type: System.Object
true to not have blank cells in the range on the Clipboard pasted into the destination range. The default value is false.
- Transpose
Type: System.Object
true 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(missing);
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.