From Xojo Documentation

Revision as of 13:18, 29 April 2020 by Gperlman (talk | contribs)

Clipboard.RawData(dataType as String, Assigns value As String)

New in 2005r1

Supported for all project types and targets.

Used to get and set binary data from/to the Clipboard as a string for the specified type or UTI.


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. An example would be "public.rtf".

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

Sample Code

This code reads the contents of the Clipbpoard as an mp3 file.

Var c As New Clipboard
Var s As String
s = c.RawData("public.mp3") // UTI

On Windows, this code gets HTML data from the Clipboard:

Var c As New Clipboard
Var html As String
html = c.RawData("HTML Format")