Clipboard

  • Thread starter Thread starter Bill
  • Start date Start date
B

Bill

Is there an interface available that would
allow for insertion of a text string into the
Windows virtual "Clipboard"?

Bill
 
never used it - but take a look at DoCmd.DoMenuItem in help:

e.g.

DoCmd.DoMenuItem acCmdCopy
 
I can't tell from the help text "what" is subject to
being copied? The discussions lead me to Access 2K
instructions in the use of: object.RunCommand acCmdCopy
instead of the outdated DoMenuItem, but the compiler
coughs if I attempt to use a text-box control as the object.
So far, I've not found examples anywhere that address the
exact use of the acCmdcopy command argument.

I might be just missing something, but so far no success.

Bill
 
Hi Bill,

Is there an interface available that would
allow for insertion of a text string into the
Windows virtual "Clipboard"?

If you're on a form, DoCmd.RunCommand acCmdCopy copies the contents of
the selected control, but that's seldom much use.

Otherwise, you have to use VBA code. Probably the most reliable way is
to use Windows API functions; there's ready-made code here:
http://www.mvps.org/access/api/api0049.htm

Alternatively, you can set a reference to the Microsoft Forms 2.0 object
library and use the DataObject object. This needs fewer visible lines of
code but is more complicated under the bonnet.
 
Thanks John,
It was the Windows API functions that I'd seen at
MSDN that I was wanting to gain access to without
"re-inventing the wheel". I totally messed up in
forgetting to search mvps.org.

Anyway, I've incorporated api0049 into a general
module and now have functional code.

Thanks,
Bill
 
Back
Top