How to copy to clipboard

DanR

Registered User.
Local time
Tomorrow, 07:07
Joined
Mar 14, 2002
Messages
54
Hello

I hope that there's a nice simple answer for this:

How do I use Access 2000 vba code to copy a text string to the general windows clipboard, so that it is ready to paste in another application?

Assuming, for example, that the text is in a variable strClip

thanks

Dan
 
I should add, that the text to be placed on the clipboard is not in a form control - there is no form open while this code is running.

That means that accessing the Copy menu command is not my preferred solution.

cheers
Dan
 
DoCmd.RunCommand acCmdCopy

HTH
 
Thanks GHudson

Now correct me if I'm wrong, but I think that acCmdCopy is the same as the copy function on the edit menu, in that it only works where text on a control has been selected.

I found a good solution from one of the old posts to this forum, which works in my case where the text to be placed on the clipboard is in a string variable, not a control.

The code looks very messy, but worked straight away for me, when I pasted it in.

See http://www.mvps.org/access/api/api0049.htm

cheers

Dan
 

Users who are viewing this thread

Back
Top Bottom