ContactItem 事件 (Outlook)ContactItem.BeforeRead event (Outlook)

在 Microsoft Outlook 开始读取项目属性之前发生。Occurs before Microsoft Outlook begins to read the properties for the item.

语法Syntax

expressionexpression. BeforeRead

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

说明Remarks

BeforeRead事件在**Read** 事件之前发生。The BeforeRead event occurs before the Read event. 与之前前缀与其他事件,此事件不是可以取消的。Unlike other events with the Before prefix, this event is not cancelable. 若要确定何时从内存中卸载该项目,请使用 Unload 事件。To determine when the item is unloaded from memory, use the Unload event.

BeforeRead事件对应于 Exchange 客户端扩展 (ECE) 事件IExchExtMessageEvents:: OnReadThe BeforeRead event corresponds to the Exchange Client Extensions (ECE) event IExchExtMessageEvents::OnRead.

BeforeRead事件中, 只能访问 item 对象的下列成员:Only the following members of the item object can be accessed in the BeforeRead event:

MAPIOBJECT属性是 Outlook 对象模型中的隐藏属性。The MAPIOBJECT property is a hidden property in the Outlook object model. 此属性提供对基础的 MAPI IMessage 对象,并且可以仅通过 IUnknown 接口调用。This property provides access to the underlying MAPI IMessage object, and can be invoked only via the IUnknown interface. 该属性是用支持 IUnknown 如 C 或 c + + 语言编写的程序可以访问的。The property is accessible to programs written in languages such as C or C++ that support IUnknown. MAPIOBJECT 不能通过 IDispatch 接口。MAPIOBJECT is not available through the IDispatch interface. 如 (VBA)、 视觉 C#,和 Visual Basic 的 Visual Basic for Applications 的开发语言都支持 IDispatch 接口并不为 IUnknown ,,因此,它们无法访问 MAPIOBJECTDevelopment languages such as Visual Basic for Applications (VBA), Visual C#, and Visual Basic support the IDispatch interface and not IUnknown, and therefore, they cannot access MAPIOBJECT. 如果在此事件中访问其他属性或方法的父项,则 Outlook 将引发错误。If other properties or methods of the parent item are accessed in this event, Outlook raises an error.

如果实施者访问基础IMessage对象并更改该对象的属性, Outlook 将呈现反映对IMessage对象所做的更改的项目。If the implementer accesses the underlying IMessage object and changes properties on that object, Outlook will render that item reflecting the changes to the IMessage object. 实施者不必在IMessage对象上调用**SaveChanges** , 便可使更改反映在 Outlook 中。The implementer does not have to call SaveChanges on the IMessage object to cause the changes to be reflected in Outlook.

实施者必须释放从事件完成前事件中的MAPIOBJECT属性获取的对象。Implementers must release the object obtained from the MAPIOBJECT property in the event before the event completes. 尝试使用该对象的事件上下文之外是不受支持,将导致不可预知的行为。Attempting to use that object outside the context of the event is unsupported and will lead to unpredictable behavior.

另请参阅See also

创建 ContactItem 对象ContactItem 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.