PDA

Click to See Complete Forum and Search --> : clipboard activex for vba, vbs etc


westconn1
Sep 27th, 2009, 12:06 AM
i am posting an activex dll to simplify the clipboard usage for vba or any script language without clipboard object

hope it may be useful to someone

usage add a reference or createobject("clipbrd.clipboard")
has same methods as vb6 clipboard object

.settext text : returns boolean, true on success
.gettext : returns string
.clear : returns boolean
.setdata object, format : format is optional clipboard format, returns boolean
.getdata(format) : returns object
format parameter is optional and should be a clipboard constant value
Constant Value Description
vbCFBitmap 2 Bitmap (.bmp files)
vbCFMetafile 3 Metafile (.wmf files)
vbCFDIB 8 Device-independent bitmap (DIB)
vbCFPalette 9 Color palette
Note the constants i copied from msdn may not all be correct, or are outdated, see
http://msdn.microsoft.com/en-us/library/ebwdx8yh.aspx


sample
Set myclip = CreateObject("clipbrd.clipboard")
SavePicture myclip.GetData(2), "C:\test\clippic.bmp"


to use unzip and register

vb6 source available if anyone wants

koolsid
Oct 2nd, 2009, 05:34 PM
Pete, I would love to see the source...

koolsid
Oct 2nd, 2009, 06:23 PM
Tested it with bmp. Works perfectly :) nice one pete :thumb:

and thanks for the source...

lenourien
Oct 9th, 2009, 06:28 PM
Hello, could I have the source please? I've been looking for something like this for a while. Many thanks in advance.

lenourien
Oct 13th, 2009, 10:50 AM
I have a question: I tried it in powerpoint but I can't copy shapes.
If I use the native .copy from powerpoint then I can use the getdata from the dll without any problem. However, the setdata on shapes doesn't put anything in the clipboard and the error message is "wrong format". So if I can't use it to copy shapes to the clipboard, what type of objects can I copy with setdata???
Thank you.