PasteSpecial

Paste the content of the clipboard in a specified control.

To

Use

Paste the object on the clipboard in OLE controls

Syntax 1

Paste the content of the clipboard in a specified format in RichTextEdit controls

Syntax 2


Syntax 1: For OLE controls

Description

Displays a standard OLE dialog allowing the user to choose whether to embed or link the OLE object on the clipboard when pasting it in the specified control. Embedding is the equivalent of calling the Paste function, and linking is the same as calling PasteLink.

Applies to

OLE controls

Syntax

olecontrol.PasteSpecial ( )

Argument

Description

olecontrol

The name of the OLE control into which you want to paste the object on the clipboard


Return value

Integer. Returns 0 if it succeeds and one of the following values if an error occurs:

1 -- User canceled without selecting a paste option

-1 -- No data found

-9 -- Other error

If ole2control is null, PasteSpecial returns null.

Usage

For information about when an object on the clipboard is linkable, see PasteLink.

Examples

If the clipboard contains an OLE object and the object's server application is running, then the following example lets the user choose to embed or link the object in the control ole_1:

integer li_result
li_result = ole_1.PasteSpecial()

See also

LinkTo

Paste

PasteLink

Syntax 2: For RichTextEdit controls

Description

Pastes the content of the clipboard in a specified format into the current position in a RichTextEdit control

Applies to

RichTextEdit controls

Syntax

rtename.PasteSpecial (ClipBoardFormat cf)

Argument

Description

rtename

The name of the RichTextEdit control into which you want to paste the content of the clipboard in a specified format into the current position

ClipBoardFormat

The format for the contents of the clipboard. Values for ClipBoardFormat are:

ClipFormatText!

ClipFormatRTF! (newly added) -- Specifies RTF format (Rich Text Format).

ClipFormatImage! (newly added) -- Specifies an image. The image can be pasted if it is a device-dependent or a device-independent bitmap, a TIFF image or a Windows metafile.

ClipFormatTIFF!

ClipFormatDIB!

ClipFormatBitmap!

ClipFormatHTML! (newly added) -- Specifies HTML (Hypertext Markup Language) format.

ClipFormatTXText! (newly added) -- Specifies formatted text in the internal TX Text Control format.

ClipFormatTXTextFrame! (newly added) -- Specifies a TX Text Control text frame and its contents. The clipboard also contains information about how the text frame is positioned in the document (inline or geometrically positioned).

ClipFormatTXImage! (newly added) -- Specifies an image including information about how the image is positioned in the document (inline or geometrically positioned).


Return value

Integer.

Returns 1 for success and -1 for failure. Returns -2 if the specified format is not supported.

Examples

This statement pastes the contents of the clipboard in ClipFormatRTF! format in the RichTextEdit rte_1:

integer li_rtn
li_rtn = rte_1.PasteSpecial (ClipFormatRTF!)

See also

Paste

PasteRTF