 text on the clipboard for
' format lFormatID:
Dim lHwndCache As Long

    If (lFormatId = CF_TEXT) Or (lFormatId = CF_UNICODETEXT) Then
        ' Use VB method, temporarily we close the clipboard:
        If (m_bClipboardIsOpen) Then
            lHwndCache = m_hWnd
            ClipboardClose
        End If
        sTextOut = Clipboard.GetText
        If (lHwndCache &lt;&gt; 0) Then
            ClipboardOpen lHwndCache
        End If
        GetTextData = True
    Else
        Dim bData() As Byte, sR As Str