Word VBA >> Retaining/discarding keystrokes

by Randy Dod » Sat, 17 Jul 2004 07:57:39 GMT

When the user is typing in a textbox, is there a way to
discard certain keystrokes in the keydown event? Such as,
if they type an "e" simply not display it. I found a
clunky way to do it by switching to a checkbox, and then
in the keyup event of the checkbox, set the focus back to
the textbox. Is there an easier way?

Conversely, I've noticed that if my code takes a long time
in the keydown event, it will lose the keystroke that
way. Of course I need to make my code faster, but short
of that, how do I make sure it doesn't get lost?


Word VBA >> Retaining/discarding keystrokes

by Jezebel » Sat, 17 Jul 2004 08:35:30 GMT


Simply zeroing the Keycode does it. Bear in mind that the codes are ANSI
keyboard codes, not character values. To remove 'e' --

If Keycode = 69 then
Keycode = 0
end if











Word VBA >> Retaining/discarding keystrokes

by Randy Dod » Sat, 17 Jul 2004 09:51:29 GMT

My email address was incorrect in the original post.

as,
time


Retaining/discarding keystrokes

by Jezebel » Sat, 17 Jul 2004 10:29:31 GMT

Lunacy to post your real email address here.









Similar Threads

1. outlook value not retained : tab require?other Possibilities Retain value in combo box(CommandBa

Thanks for the response Ken. But there should be an alternative to this, I think. I need to implement it in my project anyhow. Is the below things possible ? 

1) Can I use any other control in commandbar as an alternative to commandbarcombobox ? If yes what can I use ?

2) I think if somehow I override Kill_foucus event, I may get the value ? Am I right ? In normal windows form, I can easily attach this event, but I am not able similar event in Oultook. How can I attach a kill_focus event to COMMANDBARCOMBOBOX, using win32 API ?

I need this badly. Kindly help

Thanks

2. outlook value not retained : tab require?other Possibilities Retain value in combo box(CommandBarCom

3. Switches in Table of Authorities - retain formatting does not retain character styles

4. discarded the case holder for cd of microsoft office - Microsoft Office

5. discarded certification number/reinstall???

I discarded my box with the certificate of authenticity 
for my Office 2003.  I need to reinstall it.  I thought I 
registered the product.  What can I do?
Thanks,
Bob

6. recover a document discarded during autorecover - Word Document management

7. Discard duplicate faxnumbers or emailaddresses

Hai there,

Situation: Word 2003 faxmerge or email merge 

Question: Is there an easy way to "automatically" discard/skip duplicate 
email addresses or faxnumbers?

Thanks in advance!

Kind regards,

WiZZiX

Joeri van der Well

8. Word's "Different first page" should prompt to discard or keep