Clipboard.AddRawData

From Xojo Documentation

Method

Clipboard.AddRawData(Data As String, DataType As String)

New in 2005r1

Supported for all project types and targets.

Copies the passed data to the Clipboard using the specified MacType or UTI.

Notes

The DataType parameter supports both the older MacType and newer UTIs. If the DataType parameter is exactly 4 bytes then it is treated as a MacType for backwards compatibility. Otherwise it is treated as a UTI.

On Windows you can use the a special DataType called "HTML Format" to add or fetch HTML data from the clipboard[1].

Sample Code

The following code places the contents of TextArea1 on the Clipboard. It contains RTF text:

Dim s As String
s = TextArea1.Text // contains RTF

Dim c As Clipboard
c.AddRawData(s,"public.rtf") // UTI
c.Close