PDA

Click to See Complete Forum and Search --> : Paste The Clipboard To a File


delidumrul
Jan 4th, 2000, 08:19 AM
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 :)

Mark Sreeves
Jan 4th, 2000, 03:42 PM
There's probably a better method but here's one way of doing it...

This is straight from the help file:


' 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

Mark.Sreeves@Softlab.co.uk
A BMW Group Company