From Xojo Documentation
The Clipboard class is used to get or add data to the system-wide clipboard. The properties and methods let you determine what kind of data is available on the Clipboard, get data from the Clipboard, and send data to the Clipboard. The Clipboard class supports three kinds of data: text, picture, and binary/raw data. Raw data is represented in string form and is marked with a type you specify so you can tell what the raw binary data represents.
Getting Text from the Clipboard
Since the Clipboard can contain text, picture and binary data, you should ask it what type of data it contains before you attempt to use it. To check for text, you use the TextAvailable method:
Adding Text to the Clipboard
This code adds text to the clipboard:
The clipboard can contain any picture that can be stored in the Picture class.
Getting a Picture from the Clipboard
Since the Clipboard can contain text, picture and binary data, you should ask it what type of data it contains before you attempt to use it. To check for a picture, you use the PictureAvailable method:
Var clipPic As Picture
If c.PictureAvailable Then
clipPic = c.Picture
Adding a Picture to the Clipboard
This code adds a picture to the clipboard:
Raw data refers to any data that is not text or is not a picture. This allows you to put any type of data you want in the clipboard. Only your own apps will be able to parse custom data you put here, however. When you put data in the clipboard you can specify the data type using a UTI. Standard UTIs, such as "public.rtf" may be readable by other apps if your data is formatted properly.
Getting Raw Data from the Clipboard
Use the RawData method to get raw data from the Clipboard. The raw data is in string format and you supply a type indicator used to identify the type of data being fetched.
This code gets RTF data from the Clipboard and stores it in a Text Area:
If c.RawDataAvailable("public.rtf") Then
TextArea1.StyledText.RTFData = c.RawData("public.rtf")
Adding Raw Data from the Clipboard
Use the AddRawData method to add raw data to the clipboard, specifying the type.
This code stores the RTF data from a styled Text Area in the Clipboard so that other apps should be able to read it: