
Repost: Stop up\down cursor keys moving between (text) form fields in a protected document
Hi,
I wasn't very clear with my first posting on this subject, sorry about
that. For reference my first message read;
"Can I stop the use of the up\down cursor key press to move between
fields (next\previous). If I have a long field (well multiple lines) I
would like the up\down key press to move between lines in the field only."
What I failed to mention was that the fields in question are form fields
(mainly text) in a protected word 2000 document.
I was very kindly posted the following code, which unfortunately doesn't
seem to work with this case (thanks to Jay F)
Private Sub TextBox1_KeyDown(ByVal KeyCode As _
MSForms.ReturnInteger, ByVal Shift As Integer)
With TextBox1
Select Case KeyCode
Case vbKeyDown
If .CurLine = .LineCount - 1 Then
KeyCode = 0
Beep ' optional
End If
Case vbKeyUp
If .CurLine = 0 Then
KeyCode = 0
Beep
End If
Case Else
End Select
End With
End Sub
Again sorry for the mess I made with the original posting - hope
somebody (maybe Jay?) can help :)
Thanks