Location My.Computer.Clipboard.SetText Syntax My.Computer.Clipboard.SetText(text[, format])
text (required; String) The text to be written to the system clipboard.
format (optional; TextDataFormat enumeration) The specific format of the text to write to the system clipboard. One of the following System.Windows.Forms.TextDataFormat enumeration values. Value | Description |
---|
Not supplied | Any type of text | CommaSeparatedValue | Comma-separated fields of data in one or more records | Html | HTML format | Rtf | Rich Text Format | UnicodeText | 16-bit Unicode character text |
If this parameter is not specified, UnicodeText is used by default. Description The SetText method writes a string of text to the system clipboard in a specified text format. If no specific format is indicated, text is written as plain Unicode text. Usage at a Glance This method is only valid in non-server applications. Security restrictions in place for the active user may limit access to the system clipboard. An exception is thrown if invalid or missing string data is passed to the method. Example The following code adds basic text to the clipboard. My.Computer.Clipboard.SetText("This text is simple.") Related Framework Entries See Also Clipboard Object, ContainsText Method, GetText Method, SetAudio Method, SetData Method, SetDataObject Method, SetFileDropList Method, SetImage Method, SetText Method |