Hi,
I have a listbox name lstOptions in a form named UserForm1, which I use in
Word.
I wish that when the user presses the Enter Key in that form, it will run a
procedure named "CompleteByListSelection".
I've succeded in doing the same for the DoubleClick mouse event by using the
following code:
'Code:
Private Sub lstOptions_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
CompleteByListSelection
End Sub
How can I do the same for the Enter key press event?
I know VBA and a bit of VB.
I use Office 2000. Using API calls is also 'allowed' even though I'm not an
expert in that.
Kind Regards,
Amir.
Amir - 11 Sep 2005 01:17 GMT
Solved:
Private Sub lstOptions_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
If KeyAscii = vbKeyReturn Then
CompleteByListSelection
End If
End Sub
Regards.
> Hi,
>
[quoted text clipped - 20 lines]
> Kind Regards,
> Amir.