Keystrokes

S

Sunouchi@

Hello
I would like to know how to handle some keystrokes.
I have a textbox on a form. If that textbox has the focus, characters
enter into the textbox when I hit the keyboard.
However, if the textbox doesn't have the focus, where is the
information of the keystrokes going to? And can I still use those
keystrokes? Is there a way to use the keystrokes that seems to go into
'space'?

Another question is (perhaps related) I am working on a form and in a
document almost simutaneously. I type text continiously, then I just
want to hit a check box or an option box, so that the text that I type
goes solely into the document and not in the textbox and when I hit
the checkbox again, the text should go solely into the textbox and not
in the document. The form should not unload or hide while I am typing
text into the document. Is that possible?

Thanks in advance,
Sunouchi
 
J

Jonathan West

Hello
I would like to know how to handle some keystrokes.
I have a textbox on a form. If that textbox has the focus, characters
enter into the textbox when I hit the keyboard.
However, if the textbox doesn't have the focus, where is the
information of the keystrokes going to?

They go to whichever window has the focus.
And can I still use those
keystrokes? Is there a way to use the keystrokes that seems to go into
'space'?

Not from within Word VBA. You would need to do some system programming,
intercepting the Windows message queue and putting in your own message
handler. This can't be done from within VBA, but can be done using other
languages.
Another question is (perhaps related) I am working on a form and in a
document almost simutaneously. I type text continiously, then I just
want to hit a check box or an option box, so that the text that I type
goes solely into the document and not in the textbox and when I hit
the checkbox again, the text should go solely into the textbox and not
in the document. The form should not unload or hide while I am typing
text into the document. Is that possible?

You can use the vbModeless paremeter with the Show method of the UserForm.
The form can then stay open even when the focus moves to the underlying
document.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top