![]() |
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 all
Using Outlook 2003 vba, I am trying to intercept when new mail arrives on an additional mailbox. I have found code that does exactly what I need however it only works on the default mailbox. I tweaked the code from http://www.vbforums.com/archive/index.php/t-251607.html hoping it will work on a delegate Inbox, however it does not run automatically. Am I wasting my time? Is this possible? ... Thanks in advance. MY CODE: ''**WORKS WHEN RUN MANUALLY** Private Sub Application_NewMail() Dim oInbox As Outlook.MAPIFolder Dim oEmail As Outlook.MailItem Dim myNamespace As Outlook.NameSpace Set myOlApp = CreateObject("Outlook.Application") Set myNamespace = myOlApp.GetNamespace("MAPI") Set myRecipient = myNamespace.CreateRecipient("Barrier Officer") myRecipient.Resolve If myRecipient.Resolved Then Set oInbox = myNamespace.GetSharedDefaultFolder(myRecipient, olFolderInbox) If oInbox.UnReadItemCount 0 Then MsgBox "New Email!", vbOKOnly + vbInformation Set oInbox = Nothing Set oNS = Nothing End If End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
MsgBox Hidden | Lionel H | Outlook and VBA | 3 | April 10th 07 04:26 PM |
Delegate issue - meetings only show up after delegate opened the request | [email protected] | Outlook - Calandaring | 0 | July 21st 06 06:16 PM |
Clear multiple MsgBox!!! | RemySS | Outlook and VBA | 4 | May 5th 06 09:07 AM |
Question on frames and msgbox | Jade | Outlook - Using Forms | 4 | April 26th 06 03:12 AM |
Outlook 2002 - Delegate updates in delegate calendar? | Wazza | Outlook - Calandaring | 0 | February 1st 06 11:20 AM |