clipboard activex for vba, vbs etc-VBForums
Results 1 to 17 of 17

Thread: clipboard activex for vba, vbs etc

Threaded View

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Dec 2004
    Posts
    22,885

    clipboard activex for vba, vbs etc

    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
    vb Code:
    1. Set myclip = CreateObject("clipbrd.clipboard")
    2. SavePicture myclip.GetData(2), "C:\test\clippic.bmp"

    to use unzip and register

    vb6 source available if anyone wants
    Attached Files Attached Files
    Last edited by westconn1; Oct 13th, 2009 at 09:33 PM.
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.