Onetastic Macro Documentation >
>
>
Clipboard_Set Clipboard_Set
Puts information into the clipboard. The existing information in the clipboard is replaced with the given format and data.
Syntax
void Clipboard_Set(
String|Array<String> format,
String|Binary|Array<String|Binary> data)
Parameters
- String|Array<String> format
- Format or formats describing the data being put into the clipboard. See remarks for possible values.
- String|Binary|Array<String|Binary> data
- One or more data to be put into the clipboard. See remarks for possible values.
RemarksYou can put a single type of information into the clipboard or put multiple different formats at the same time so
that the application receiving the clipboard data upon paste can choose the best option from the different formats
provided. For example you can put plain text, HTML, and image data at the same time into the clipboard.
To put single type of information, provide the format in the format parameter as a string and provide
the corresponding data in the data parameter.
To put multiple types of information, provide an array of formats in the format parameter, each being
a string and then provide an array of data in the data parameter, each describing the data for
the corresponding format in the format parameter.
Following is the list of valid formats and corresponding data types:
Format |
Description |
Data |
"plain" |
Plain text to be put into the clipboard |
A string containing the text |
"html" |
Formatted HTML to be put into the clipboard. GetFormattedObjectContent function can be used to convert
OneNote page content into HTML. |
A string containing the HTML |
"image" |
Binary image data to be put into the clipboard. This can be obtained from an Image object with its
data property. |
A binary object containing the image data |
Examples
Clipboard_Set("plain", "Some text")
Clipboard_Set("html", "Some <b>Text</b>")
Clipboard_Set(Array("plain", "html"), Array("Some text", "Some <b>Text</b>"))
$outline = GetCurrentPage().outlines[0]
Clipboard_Set("html", GetFormattedObjectContent($outline, "html"))
$image = GetCurrentPage().images[0]
Clipboard_Set("image", $image.data)
|