Partager via


View.PasteSpecial Method

Pastes the current contents of the Clipboard into the view represented by the View object.

Namespace:  Microsoft.Office.Interop.PowerPoint
Assembly:  Microsoft.Office.Interop.PowerPoint (in Microsoft.Office.Interop.PowerPoint.dll)

Syntax

'Declaration
Sub PasteSpecial ( _
    DataType As PpPasteDataType, _
    DisplayAsIcon As MsoTriState, _
    IconFileName As String, _
    IconIndex As Integer, _
    IconLabel As String, _
    Link As MsoTriState _
)
'Usage
Dim instance As View
Dim DataType As PpPasteDataType
Dim DisplayAsIcon As MsoTriState
Dim IconFileName As String
Dim IconIndex As Integer
Dim IconLabel As String
Dim Link As MsoTriState

instance.PasteSpecial(DataType, DisplayAsIcon, _
    IconFileName, IconIndex, IconLabel, _
    Link)
void PasteSpecial(
    PpPasteDataType DataType,
    MsoTriState DisplayAsIcon,
    string IconFileName,
    int IconIndex,
    string IconLabel,
    MsoTriState Link
)

Parameters

  • DataType
    Type: Microsoft.Office.Interop.PowerPoint.PpPasteDataType
    A format for the Clipboard contents when they are inserted into the document. The default value varies, depending on the contents in the Clipboard. An error occurs if the specified data type in the DataType argument is not supported by the clipboard contents.
  • IconFileName
    Type: System.String
    If DisplayAsIcon is set to msoTrue, this argument is the path and file name for the file in which the icon to be displayed is stored. If DisplayAsIcon is set to msoFalse, this argument is ignored.
  • IconIndex
    Type: System.Int32
    If DisplayAsIcon is set to msoTrue, this argument is a number that corresponds to the icon you want to use in the program file specified by IconFilename. Icons appear in the Change Icon dialog box, accessed from the Insert tab (click Object, select Display as icon, click Change Icon): 0 (zero) corresponds to the first icon, 1 corresponds to the second icon. If this argument is omitted, the first (default) icon is used. If DisplayAsIcon is set to msoFalse, this argument is ignored. If IconIndex is outside the valid range, the default icon (index 0) is used.
  • IconLabel
    Type: System.String
    If DisplayAsIcon is set to msoTrue, this argument is the text that appears below the icon. If this label is missing, Microsoft PowerPoint generates an icon label based on the Clipboard contents. If DisplayAsIcon is set to msoFalse, this argument is ignored.
  • Link
    Type: Microsoft.Office.Core.MsoTriState
    Determines whether to create a link to the source file of the Clipboard contents. An error occurs if the Clipboard contents do not support a link.

Remarks

An error occurs if there is no data on the Clipboard when the PasteSpecial(PpPasteDataType, MsoTriState, String, Int32, String, MsoTriState) method is called.

Valid views for the PasteSpecial(PpPasteDataType, MsoTriState, String, Int32, String, MsoTriState) method are the same as those for the Paste() method. If the data type can’t be pasted into the view (for example, if you try to paste a picture into Slide Sorter View), an error occurs.

The DataType parameter can be one of these PpPasteDataType constants

ppPasteBitmap

ppPasteDefault

ppPasteEnhancedMetafile

ppPasteGIF

ppPasteHTML

ppPasteJPG

ppPasteMetafilePicture

ppPasteOLEObject

ppPastePNG

ppPasteRTF

ppPasteShape

ppPasteText

The DisplayAsIcon parameter can be one of the following MsoTriState constants:

Constant

Description

msoFalse

The default. Does not display the embedded object (or link) as an icon.

msoTrue

Displays the embedded object (or link) as an icon.

The Link parameter can be one of the following MsoTriState constants:

Constant

Description

msoFalse

The default. Does not create a link to the source file of the Clipboard contents.

msoTrue

Creates a link to the source file of the Clipboard contents.

See Also

Reference

View Interface

View Members

Microsoft.Office.Interop.PowerPoint Namespace