OlkTextBox 事件(Outlook)OlkTextBox.KeyPress event (Outlook)

当用户按某个 ANSI 键时发生。Occurs when the user presses an ANSI key.

语法Syntax

expressionexpression. KeyPress( _KeyAscii_ )KeyPress( _KeyAscii_ )

_表达式_一个代表OlkTextBox对象的变量。expression A variable that represents an OlkTextBox object.

参数Parameters

名称Name 必需/可选Required/Optional 数据类型Data type 说明Description
KeyAsciiKeyAscii 必需Required LongLong 所按键的数值。The numerical value of the key pressed.

备注Remarks

一个 ANSI 键是一种用户按下它时生成可键入字符。An ANSI key is one that produces a typeable character when the user presses it. 当用户在运行时该窗体的窗体上按一个 ANSI 键或上的某个控件具有焦点时,将发生 KeyPress 事件。The KeyPress event occurs when the user presses an ANSI key on a running form while the form or a control on it has the focus. 之前或之后释放该键,则可能发生此事件。The event can occur either before or after the key is released.

在下列情况下,不发生 KeyPress 事件:A KeyPress event does not occur under the following conditions:

  • tabPressing TAB

  • enterPressing ENTER

  • 按箭头键Pressing an arrow key

  • 当键击导致焦点从一个控件移到另一个控件时。When a keystroke causes the focus to move from one control to another.

另请参阅See also

所示的对象OlkTextBox Object

支持和反馈Support and feedback

有关于 Office VBA 或本文档的疑问或反馈?Have questions or feedback about Office VBA or this documentation? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.