XmlMappedRange.PasteSpecial 方法

定義

將 [剪貼簿] 中 Range 的內容貼到 XmlMappedRange 控制項。

public object PasteSpecial (Microsoft.Office.Interop.Excel.XlPasteType Paste = Microsoft.Office.Interop.Excel.XlPasteType.xlPasteAll, Microsoft.Office.Interop.Excel.XlPasteSpecialOperation Operation = Microsoft.Office.Interop.Excel.XlPasteSpecialOperation.xlPasteSpecialOperationNone, object SkipBlanks, object Transpose);
abstract member PasteSpecial : Microsoft.Office.Interop.Excel.XlPasteType * Microsoft.Office.Interop.Excel.XlPasteSpecialOperation * obj * obj -> obj
Public Function PasteSpecial (Optional Paste As XlPasteType = Microsoft.Office.Interop.Excel.XlPasteType.xlPasteAll, Optional Operation As XlPasteSpecialOperation = Microsoft.Office.Interop.Excel.XlPasteSpecialOperation.xlPasteSpecialOperationNone, Optional SkipBlanks As Object, Optional Transpose As Object) As Object

參數

SkipBlanks
Object

true 表示不讓 [剪貼簿] 中範圍內的空白儲存格貼到目的範圍內。 預設值是 false

Transpose
Object

true 表示貼上範圍時調換列和欄。 預設值是 false

傳回

範例

下列程式代碼範例會 Copy 使用 方法將 複製到 XmlMappedRange 剪貼簿,然後使用 PasteSpecial 方法將範圍複製到不同的 XmlMappedRange。 此程式代碼範例假設目前的工作表包含名為 和CustomerLastNameCell的兩XmlMappedRangeCustomerFirstNameCell控件。

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

備註

選擇性參數

如需選擇性參數的資訊,請參閱 Office 方案中的選擇性參數

適用於