mory:
        lPtr = GlobalLock(hMem)
        If (lSize &gt; 0) Then
            ' Resize the byte array to hold the data:
            ReDim bData(0 To lSize - 1) As Byte
            ' Copy from the pointer into the array:
            CopyMemory bData(0), ByVal lPtr, lSize
        End If
        ' Unlock the memory block:
        GlobalUnlock hMem
        ' Success:
        GetBinaryData = (lSize &gt; 0)
        ' Don't free the memory - it belongs to the clipboard.
    End If
End Function
Public Function G