VB Code:
Option Explicit
Private Sub txtSuppSurn_Change()
DisablePaste txtSuppSurn
End Sub
Public Sub DisablePaste(box As TextBox)
Dim Position As Integer
Position = box.SelStart
If box.SelStart - Len(Clipboard.GetText) >= 0 Then
box.SelStart = box.SelStart - Len(Clipboard.GetText)
box.SelLength = Len(Clipboard.GetText)
If box.SelText = Clipboard.GetText Then
If Len(box.Text) > Len(box.Tag) + 1 Then
box.SelText = ""
Else
box.SelStart = Len(box.Text)
End If
Else
box.SelStart = Position
End If
box.SetFocus
box.Tag = box.Text
End If
End Sub