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 :)
Printable View
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 :)
There's probably a better method but here's one way of doing it...
This is straight from the help file:
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 fileCode:
' 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.
------------------
Mark Sreeves
Analyst Programmer
[email protected]
A BMW Group Company