![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
Hi,
Im trying to catch all incoming new mail using the code below. The problem is that it is only run once, so when i get 3 new messages, only the first mail will be used in the eventhandler. -- private void ThisAddIn_Startup(object sender, System.EventArgs e) { Outlook.MAPIFolder inbox = Application.Session.GetDefaultFolder(Outlook.OlDef aultFolders.olFolderInbox); inbox.Items.ItemAdd += new Outlook.ItemsEvents_ItemAddEventHandler(inboxFolde rItemAdded); } public void inboxFolderItemAdded(object item) { if (item is Outlook.MailItem) { Outlook.MailItem mail = (Outlook.MailItem)item; MessageBox.Show(mail.Subject.ToString()); } } |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Windows Installer runs | Invisible | Outlook - General Queries | 2 | October 3rd 06 09:53 AM |
Macro runs on startup | jbc | Outlook - Installation | 1 | September 20th 06 07:40 PM |
ThisOutlookSession - code runs only once | Rafael1119 | Outlook and VBA | 8 | July 17th 06 11:51 AM |
Outlook 2003 "find" contacts doesn't work, just runs and runs | Tom Stanley | Outlook - Using Contacts | 1 | July 5th 06 03:56 AM |
Outlook Express runs without .exe | DiscoNap9000 | Outlook Express | 3 | May 29th 06 11:18 PM |