Bookmark.PasteSpecial Method (Object, Object, Object, Object, Object, Object, Object)


Inserts the contents of the Clipboard into the Bookmark control.

Namespace:   Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word (in Microsoft.Office.Tools.Word.dll)

void PasteSpecial(
	ref object IconIndex,
	ref object Link,
	ref object Placement,
	ref object DisplayAsIcon,
	ref object DataType,
	ref object IconFileName,
	ref object IconLabel


Type: System.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: 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.

Type: System.Object

true to create a link to the source file of the Clipboard contents. The default value is false.

Type: System.Object

Can be either of the following T:Microsoft.Office.Interop.Word.WdOLEPlacement constants: F:Microsoft.Office.Interop.Word.WdOLEPlacement.wdFloatOverText or F:Microsoft.Office.Interop.Word.WdOLEPlacement.wdInLine. The default value is F:Microsoft.Office.Interop.Word.WdOLEPlacement.wdInLine.

Type: System.Object

true to display the link as an icon. The default value is false.

Type: System.Object

A format for the Clipboard contents when they are inserted into the document. T:Microsoft.Office.Interop.Word.WdPasteDataType.

Type: System.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.

Type: System.Object

If DisplayAsIcon is true, this argument is the text that appears below the icon.

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 Office Excel worksheet).

Calling this method might delete the Bookmark control.

For information on optional parameters, see Optional Parameters in Office Solutions.

The following code example inserts the Clipboard contents in the Bookmark control as unformatted text. This example assumes that the Clipboard contains some text.

This example is for a document-level customization.

private void BookmarkPasteSpecial()
    Microsoft.Office.Tools.Word.Bookmark bookmark1 =

    object DataType = Word.WdPasteDataType.wdPasteText;
    bookmark1.PasteSpecial(ref missing, ref missing, ref missing,
        ref missing, ref DataType, ref missing, ref missing);
Return to top