A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Msgbox prompt on Delegate Inbox



 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old September 10th 07, 06:47 AM posted to microsoft.public.outlook.program_vba
Sydney[_2_]
external usenet poster
 
Posts: 5
Default Msgbox prompt on Delegate Inbox

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
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


All times are GMT +1. The time now is 06:09 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.