VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Check clipboard then auto copy text to Notepad.

by Wayne Alec de Bruin (6 Submissions)
Category: Windows System Services
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Mon 4th November 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Check clipboard then auto copy text to Notepad.

API Declarations



-->
You Need: Command button with name Command1 & Text Box with name Text1 containing some text.

* Paste code in the button (To check for images by pressing Printscreen on keyboard)

Rate Check clipboard then auto copy text to Notepad.



'Contact: [email protected]
'
'FIRST CHECK IF CLIPBOARD IS EMPTY.
'
'Text in clipboard.
If Clipboard.GetText = "" Then 'Text from the clipboard is pasted in text1.text
Else
   If MsgBox("Delete existing text in clipboard ?", vbYesNo + vbDefaultButton2 Or vbExclamation, "Clipboard Contents") = vbYes Then
   Clipboard.Clear 'Clear clipboard.
   GoTo SendToNotepad:
   End If
Exit Sub
End If
'
'Image in clipboard.
If Clipboard.GetData Then 'If the data in the clipboard is a  picture then it is pasted in pciture1.picture
   If MsgBox("Delete existing image in clipboard ?", vbYesNo + vbDefaultButton2 Or vbExclamation, "Clipboard Contents") = vbYes Then
   Clipboard.Clear 'Clear clipboard.
   GoTo SendToNotepad:
End If
Exit Sub
End If
'
SendToNotepad:
'
Clipboard.Clear
Clipboard.SetText Text1.Text
Shell "notepad", 1
SendKeys "^V"
'
End Sub


Download this snippet    Add to My Saved Code

Check clipboard then auto copy text to Notepad. Comments

No comments have been posted about Check clipboard then auto copy text to Notepad.. Why not be the first to post a comment about Check clipboard then auto copy text to Notepad..

Post your comment

Subject:
Message:
0/1000 characters