Working with the windows clipboard in VBA code
Posted on 2005-04-18
I am wanting to be able to make use of the Windows clipboard from within VBA code in an Access database. Is this at all possible? I have found on Chuck Pearson's website an example of how to do this with Microsoft Excel, but not Access. I have at least a couple business applications where this would come in handy, and maybe a couple personal ones as well, in the future. Anyway, what I want to do cannot be done with the SendKeys function, b/c that for some reason does not want to work correctly with the program I have to send the text to.
Regardless of what I find to be the best method to deal with sending text to another program, I really want to find out how to basically save the string stored in a variable to the Windows clipboard, so that it's available to paste to a separate application. I can get the values I need into a variable, I just need to transfer from that variable to the clipboard. It would not be much data, so it would not be an issue of having enough system memory or anything along those lines.
I've considered using the Windows API - I don't know if that's related to the clipboard, but from other things I've heard and read, it sounds like it may be what I really need. The copy/paste deal was hopefully an inbetween until I can learn the API better.
If someone has any recommendations on the API references, and how to use with VBA, I'm all ears. I'd like to find a good reference somewhere - I'd prefer a website, but if it means I have to buy another book, then I may can do that, as well.
Thanks for any help/info on this one!