Results 1 to 2 of 2

Thread: Paste The Clipboard To a File

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Location
    Izmit
    Posts
    2

    Post

    i am trying to paste the clipboard to a file , and i am stuck if u know something about this pls post me a message

  2. #2
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845

    Post

    There's probably a better method but here's one way of doing it...

    This is straight from the help file:
    Code:
    ' Define bitmap formats.
      Dim ClpFmt, Msg ' Declare variables.
      On Error Resume Next  ' Set up error handling.
      If Clipboard.GetFormat(vbCFText) Then ClpFmt = ClpFmt + 1
      If Clipboard.GetFormat(vbCFBitmap) Then ClpFmt = ClpFmt + 2
      If Clipboard.GetFormat(vbCFDIB) Then ClpFmt = ClpFmt + 4
      If Clipboard.GetFormat(vbCFRTF) Then ClpFmt = ClpFmt + 8
      Select Case ClpFmt
        Case 1
        
          Msg = "The Clipboard contains only text."
        
        Case 2, 4, 6
          Msg = "The Clipboard contains only a bitmap."
        Case 3, 5, 7
          Msg = "The Clipboard contains text and a bitmap."
        Case 8, 9
          Msg = "The Clipboard contains only rich text."
        Case Else
          Msg = "There is nothing on the Clipboard."
      End Select
      MsgBox Msg  ' Display message.
    all you need to do now is modify the select statement to load the clipboard data into a suitable control and then save the contents of the control to file

    ------------------
    Mark Sreeves
    Analyst Programmer

    [email protected]
    A BMW Group Company

Posting Permissions

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



Click Here to Expand Forum to Full Width