VBA: Read file from clipboard
Posted
by ReturningTarzan
on Stack Overflow
See other posts from Stack Overflow
or by ReturningTarzan
Published on 2010-05-26T13:29:21Z
Indexed on
2010/05/26
13:31 UTC
Read the original article
Hit count: 533
I'm trying to load a file in a VBA macro that has been copied from, say, an Explorer window.
I can easily get the data from the clipboard using DataObject::GetFromClipboard, but the VBA interface to DataObject doesn't seem to have methods for working with any other formats than plain text. There are only GetText and SetText methods.
If I can't get a file stream directly from the DataObject, the filename(s) would also do, so maybe GetText could be forced to return the name of a file placed on the clipboard?
There is very little documentation to be found for VBA anywhere. :(
Maybe someone could point me to an API wrapper class for VBA that has this sort of functionality?
© Stack Overflow or respective owner