Determine clipboard data type?
"RG III" wrote in message
I'm using the following code to get the clipboard contents:
obj.GetFromClipboard
txt = obj.GetText(1)
But how do I determine if the clipboard contains data other than plain
text? Like what if it contains a screen snapshot in bitmap format or
something else?
DataObject methods only handle text, if available. No doubt the original
intention last century was eventually for it to return other formats, but
that never happened.
Simplest is to use the Excel object model's 'ClipboardFormats' which returns
an array of available formats, see ClipboardFormats in help. You could also
use the 'IsClipboardFormatAvailable' API to see if a specified format is
available (examples on line), be aware also need to open and close the
clipboard with OpenClipboard and CloseClipboard.
Peter T
|