read and open events firing strangely in Outlook 2003 VBA
Posted on 2009-02-11
I'm trying to program Outlook 2003 so that whenever I open an e-mail message from my inbox by double-clicking on it, an event would fire that would save the message out to a database. I tried using read and open as the events as shown below: however, neither of them are firing. The only time I got them to fire is when I double-click on the first message in my inbox (which as you can see it is what I initialize my variable to). And even when I double-click on the first message in my inbox, I get different behavior from the read event and the open event. In fact the read event only gets fired the first time I open that message while the open event fires over and over again on that message. Unfortunately, whenever I open up any other message in the inbox none of those events fire. What am I doing wrong?
Public WithEvents myItem As Outlook.MailItem
Set myItem = Application.ActiveExplorer.CurrentFolder.Items(1)
Private Sub Application_Startup()
Private Sub myItem_Open(Cancel As Boolean)
Public Sub myItem_Read()