sachin.acharya
Board Regular
- Joined
- Nov 5, 2009
- Messages
- 93
Hi Gurus..
I have a textbox where I want user to only type in manually and not copy any text from somewhere and paste it into the textbox.
How do I disable the paste option when the cursor is in a textbox.
This is what I tried and the reason it failed:
Private Sub txtPassword_Enter()
Call ClearClipboard
End Sub
Sub ClearClipboard()
Dim strDO As DataObject
Set strDO = New DataObject
With strDO
.SetText ""
.PutInClipboard
End With
End Sub
Why it failed? Well it clears the clipboard when the user "Enters" the textbox. If the cursor is already in the textbox, it doesn't help.
Any help is appreciated.
I have a textbox where I want user to only type in manually and not copy any text from somewhere and paste it into the textbox.
How do I disable the paste option when the cursor is in a textbox.
This is what I tried and the reason it failed:
Private Sub txtPassword_Enter()
Call ClearClipboard
End Sub
Sub ClearClipboard()
Dim strDO As DataObject
Set strDO = New DataObject
With strDO
.SetText ""
.PutInClipboard
End With
End Sub
Why it failed? Well it clears the clipboard when the user "Enters" the textbox. If the cursor is already in the textbox, it doesn't help.
Any help is appreciated.
Last edited: