編輯

共用方式為


Selection.PasteSpecial Method

Definition

Inserts the contents of the Clipboard.

public void PasteSpecial (ref object IconIndex, ref object Link, ref object Placement, ref object DisplayAsIcon, ref object DataType, ref object IconFileName, ref object IconLabel);
abstract member PasteSpecial : obj * obj * obj * obj * obj * obj * obj -> unit
Public Sub PasteSpecial (Optional ByRef IconIndex As Object, Optional ByRef Link As Object, Optional ByRef Placement As Object, Optional ByRef DisplayAsIcon As Object, Optional ByRef DataType As Object, Optional ByRef IconFileName As Object, Optional ByRef IconLabel As Object)

Parameters

IconIndex
Object

Optional Object. If DisplayAsIcon is True, 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 (Insert menu, Object command, Create New tab): 0 (zero) corresponds to the first icon, 1 corresponds to the second icon, and so on. If this argument is omitted, the first (default) icon is used.

Link
Object

Optional Object. True to create a link to the source file of the Clipboard contents. The default value is False.

Placement
Object

Optional Object. Can be either of the following WdOLEPlacement constants: wdFloatOverText or wdInLine. The default value is wdInLine.

DisplayAsIcon
Object

Optional Object. Optional Object. True to display the link as an icon. The default value is False.

DataType
Object

Optional Object. A format for the Clipboard contents when they're inserted into the document. WdPasteDataType.

IconFileName
Object

Optional Object. If DisplayAsIcon is True, this argument is the path and file name for the file in which the icon to be displayed is stored.

IconLabel
Object

Optional Object. If DisplayAsIcon is True, this argument is the text that appears below the icon.

Remarks

If you don't want to replace the contents of the specified selection, use the Collapse(Object) method before you use this method. When you use this method, the selection doesn't expand to include the contents of the Clipboard.

Unlike with the Paste() method, with PasteSpecial you can control the format of the pasted information and (optionally) establish a link to the source file (for example, a Microsoft Excel worksheet).

Applies to