In an older sample, I showed how to implement a paste special functionality by accessing the clipboard directly using .NET functionality.

In version 15.0, we implemented this functionality directly into the Paste method. A new implementation of this method allows you to pass a ClipboardFormat in the constructor.

public void Paste(ClipboardFormat format);

The available formats can be retrieved using the GetClipboardFormats method. This method returns an array of the available formats. Possible values are:

  • HTMLFormat
  • Image
  • PlainText
  • RichTextFormat
  • TXTextControlFormat
  • TXTextControlImage
  • TXTextControlTextframe

Consider a formatted text that has been copied into the clipboard in MS Word. The text will be available as RTF and plain text in the clipboard in this case. By using the following code, the formatted text will pasted into TX Text Control:

public void Paste(ClipboardFormat.RichTextFormat);

It might be required to paste only the text without any formatting. In this case, you can use the following code:

public void Paste(ClipboardFormat.PlainText);