Getting RTF Text off the clipboard.
Option Strict On
Option Explicit On
Imports System
Imports System.Windows.Forms
Imports System.Drawing
Imports Microsoft.VisualBasic
Public Class Form1
Inherits Form
Public Sub New()
Me.Text = "Clipboard Test"
AddHandler Me.Click, AddressOf MouseClick
End Sub
Public Sub MouseClick(byval sender As object, byval e As EventArgs)
If Not Clipboard.GetDataObject() Is Nothing
Dim dobj As IDataObject = Clipboard.GetDataObject()
If dobj.GetDataPresent(DataFormats.RTF) then
Dim rtfobj As Object = dobj.GetData(DataFormats.RTF)
MsgBox(rtfobj.ToString())
End if
End if
End Sub
<STAThread()> _
Shared Sub Main()
Application.Run(New Form1())
End Sub
End Class