SETDATA Method (Clipboard)
Description
Places data on the clipboard in the specified format.
Syntax
SuccessFlag = Exec_Method( "CLIPBOARD", "SETDATA", FormatName, ClipData )
Parameters
Name | Required | Description |
---|---|---|
FormatName | Yes | Name of the format to mark the data as. This can be one of the common formats listed below (pass as a literal string), or a custom format (can be any string) • CF_TEXT • CF_BITMAP • CF_METAFILEPICT • CF_SYLK • CF_DIF • CF_TIFF • CF_OEMTEXT • CF_DIB • CF_PALETTE • CF_PENDATA • CF_RIFF • CF_WAVE • CF_UNICODETEXT • CF_ENHMETAFILE • CF_HDROP • CF_LOCALE • CF_DIBV5 |
Returns
TRUE$ if the data was set on the clipboard successfully, or FALSE$ otherwise.
Remarks
The SETDATA method can be called multiple times to set the data in different formats on the clipboard.
This is basically a wrapper around the SetClipboardData Windows API function, so it is worth examining at the documentation for this on the MSDN website to get a better idea of the capabilities of this method.
Example
// CLIPBOARD SETDATA example // // Set some html data and a text version Declare Function Str_Unicode FormatID = "text/html" ClipData = "<b>HTML<b> text <i>to</i> set." Call Exec_Method( "CLIPBOARD", "SETDATA", FormatID, ClipData ) // Set the text as Unicode text FormatID = "CF_UNICODETEXT" ClipData = Str_Unicode( "Text to set" ) Call Exec_Method( "CLIPBOARD", "SETDATA", FormatID, ClipData )
See Also
FORMATLIST property, TEXT property, GETDATA method.