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

Re: Keystrokes by Jonathan

Jonathan
Wed Aug 01 05:57:00 CDT 2007


<Sunouchi@> wrote in message
news:ctava35olqima5dj4c7a7465fbmpbvnde4@4ax.com...
> 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.


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup