Author Topic: Access Clipboard from VBA?  (Read 2767 times)

0 Members and 1 Guest are viewing this topic.

Atook

  • Swamp Rat
  • Posts: 1029
  • AKA Tim
Access Clipboard from VBA?
« on: October 23, 2007, 11:42:27 PM »
From my looking around, it looks like I need to use windows APIs for to access the clipboard. This always seems so...clumsy.

Is there anyway to do it in straight VBA from AutoCAD? I'd like to put a value from a calculation on the clipboard..


FengK

  • Guest
Re: Access Clipboard from VBA?
« Reply #1 on: October 24, 2007, 02:46:33 AM »
this can be one way:
download and install AutoIt (free) from
http://www.autoitscript.com/cgi-bin/getfile.pl?autoit3/autoit-v3-setup.exe

which comes with AutoItX (a DLL version of AutoIt v3 that provides a subset of the features of AutoIt via an ActiveX/COM and DLL interface)

among other functions, AutoItX offers ClipGet and ClipPut function. Once the .dll is registered, to use the functions is simple:

Set oAutoIt = CreateObject("AutoItX3.Control")
text = oAutoIt.ClipGet()
oAutoIt.ClipPut "I am copied to the clipboard"

Guest

  • Guest
Re: Access Clipboard from VBA?
« Reply #2 on: October 24, 2007, 08:42:49 AM »