![]() |
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
|
|||
|
|||
![]()
I have been looking over the Internet for a solution in Outlook 2000 that
will let me show a popup window whenever a new email comes in. In the ThisOutlookSession all I see is an event for Application_NewMail(), but I have seen Microsoft MVP's on some sites saying that you should use the ItemAdd event, however I do not see this in Outlook 2000. Did it not come around until Office XP? This is my code right now: Private Sub Application_NewMail() Dim myitem As Object Set myitem = Me.GetNamespace("MAPI").GetDefaultFolder(olFolderI nbox).Items(1) Dim subj, from As String subj = myitem.Subject from = "Receipt" On Error Resume Next from = myitem.SenderName On Error GoTo 0 Shell "c:\mycode\PopupMessage\bin\Debug\PopupMessage .exe """ & from & """ """ & subj & """", vbNormalNoFocus Set myitem = Nothing End Sub It basically just looks at the first item in the Inbox whenever a NewMail hits, I then invoke a small Windows app I made in C# (luckily I have Visual Studio .NET on this computer, just not Office 2003...) that displays the from/subj for 3 seconds in a small window and quits. I used the On Error b/c it looks like if the item is a Read Receipt, it doesn't have a SenderName attached to it. |
Ads |
#2
|
|||
|
|||
![]()
ItemAdd event *is* exposed in Outlook 2000, but it is the event on the Items
collection (MAPIFolder.Items). Do not assume that the newly delivered message will be the first (or last) message in the Inbox. Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "BlockNinja" wrote in message ... I have been looking over the Internet for a solution in Outlook 2000 that will let me show a popup window whenever a new email comes in. In the ThisOutlookSession all I see is an event for Application_NewMail(), but I have seen Microsoft MVP's on some sites saying that you should use the ItemAdd event, however I do not see this in Outlook 2000. Did it not come around until Office XP? This is my code right now: Private Sub Application_NewMail() Dim myitem As Object Set myitem = Me.GetNamespace("MAPI").GetDefaultFolder(olFolderI nbox).Items(1) Dim subj, from As String subj = myitem.Subject from = "Receipt" On Error Resume Next from = myitem.SenderName On Error GoTo 0 Shell "c:\mycode\PopupMessage\bin\Debug\PopupMessage .exe """ & from & """ """ & subj & """", vbNormalNoFocus Set myitem = Nothing End Sub It basically just looks at the first item in the Inbox whenever a NewMail hits, I then invoke a small Windows app I made in C# (luckily I have Visual Studio .NET on this computer, just not Office 2003...) that displays the from/subj for 3 seconds in a small window and quits. I used the On Error b/c it looks like if the item is a Read Receipt, it doesn't have a SenderName attached to it. |
Thread Tools | Search this Thread |
Display Modes | |
|
|