Firing Order of Events
For item-level events, you can clearly predict the sequence in which events will fire. However, events at the application level are less predictable. You cannot guarantee that event firing will follow a specific sequence either because different events cause a unique firing sequence or because, in future versions of Outlook, the event sequence might change. Some insights into a typical firing sequence are offered here. If you want to investigate further, it is suggested that you write Debug.Print Object EventName statements for each event procedure supported by a given object variable declared using the WithEvents keyword. The following list shows just such a debug sequence when a user opens a mail message, enters recipients for the message, types a subject and message body, and then sends the message. Again, don't take this sequence as invariable; it simply gives you a reasonable expectation of the event sequence when you send a mail message.
- Inspectors NewInspector
- MailItem Open
- Explorer Deactivate
- Inspector Activate
- MailItem Read
- MailItem PropertyChange To
- MailItem PropertyChange CC
- MailItem PropertyChange BCC
- MailItem BeforeCheckNames
- MailItem PropertyChange To
- MailItem PropertyChange CC
- MailItem PropertyChange BCC
- MailItem PropertyChange Conversation Index
- MailItem PropertyChange ReceivedTime
- MailItem PropertyChange Subject
- Application ItemSend
- MailItem Write
- MailItem Close
- Inspector Deactivate
- Explorer Activate
No comments:
Post a Comment