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

在 Microsoft Outlook 保存项目之后发生。Occurs after Microsoft Outlook has saved the item.


expressionexpression. AfterWrite

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


AfterWrite事件发生在**Write** 事件之后。The AfterWrite event occurs after the Write event. 此事件不是可以取消的。This event is not cancelable. 若要确定何时从内存中卸载该项目,请使用 Unload 事件。To determine when the item is unloaded from memory, use the Unload event.

AfterWrite事件对应于 Exchange 客户端扩展 (ECE) 事件IExchExtMessageEvents:: OnWriteCompleteThe AfterWrite event corresponds to the Exchange Client Extensions (ECE) event IExchExtMessageEvents::OnWriteComplete.

AfterWrite事件中, 只能访问 item 对象的下列成员:Only the following members of the item object can be accessed in the AfterWrite 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.

从此事件中的MAPIOBJECT属性获取的对象必须包含 Outlook 保存的所有更改。The object obtained from the MAPIOBJECT property in this event must contain all the changes persisted by Outlook. 实施者可以调用 SaveChanges IMessage 对象以保持对基础 IMessage 对象由 MAPIOBJECT ,更改,Outlook 将不会还原这些更改。The implementer can call the SaveChanges method on the IMessage object to persist changes to the underlying IMessage object represented by MAPIOBJECT, and Outlook will not revert those changes.

实施者必须释放从事件完成前事件中的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.