EditPasteSpecial

Syntax

EditPasteSpecial [.IconNumber = number] [, .Link = number] [, .DisplayIcon = number] [, .Class = text] [, .DataType = text] [, .IconFilename = text] [, .Caption = text]

Remarks

Inserts the contents of the Clipboard at the insertion point. The arguments for the EditPasteSpecial statement correspond to the options in the Paste Special dialog box (Edit menu). Unlike EditPaste, EditPasteSpecial allows you to control the format of the pasted information and to establish a link with the information source (for example, a Microsoft Excel worksheet).

Argument

Explanation

.IconNumber

If .DisplayIcon is set to 1, a number corresponding to the icon you want to use in the program file specified by .IconFilename. Icons appear in the Change Icon dialog box (Object command, Insert menu): 0 (zero) corresponds to the first icon, 1 to the second icon, and so on. If omitted, the first (default) icon is used.

On the Macintosh, icons for embedded objects cannot be changed; this argument is ignored.

.Link

Specifies whether or not to create a link:

0 (zero) or omitted No link is created.

1 A link is created.

.DisplayIcon

Specifies whether or not to display a link as an icon:

0 (zero) or omitted Link is not displayed as an icon.

1 Link is displayed as an icon.

.Class

The object class of the Clipboard contents. This argument cannot be set. However, you can define a dialog record as EditPasteSpecial and then use the dialog record to return the current value of .Class.


Argument

Explanation

.DataType

Specifies a format for the pasted contents:

Bitmap Bitmap (Windows only)

DIB Device Independent Bitmap (Windows only)

Object Object linking and embedding (OLE) object

PICT Metafile (Windows) or Word Picture (Macintosh)

RTF Rich-text format

Text Unformatted text

Styled Formatted text that preserves font formatting (Macintosh only)

.IconFilename

If .DisplayIcon is set to 1, the path and filename of the program file in which the icon to be displayed is stored.

On the Macintosh, icons for embedded objects cannot be changed; this argument is ignored.

.Caption

If .DisplayIcon is set to 1, the caption of the icon to be displayed; if omitted, Word inserts the name of the object.


Note

Not all data types are available for each Clipboard item. For example, in Windows, if the Clipboard contains a text selection from a Word document, the available data types are "Object," "PICT, "RTF," and "Text." For a selection from a Microsoft Excel worksheet, the available formats are "Bitmap," "Object," "PICT," "RTF," and "Text." If you specify an unavailable data type, an error occurs.

See Also

EditCopy, EditCreatePublisher, EditCut, EditLinks, EditPaste, EditSubscribeTo, InsertField