![]() |
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,
Just getting started with Outlook and VBA and am wondering if this is possible. I can write a macro that will monitor my Mailbox for incoming mails, but I would like to monitor another mailbox and have it alert me when a new message arives. e.g. We have an IT malbox that myself and someone else monitors. If we are not at our desk when a new message arrives, we are not alerted. I would like a message box to permanently be displayed when a new mail message arrives in the IT mailbox. Hope someone can point me in the right direction Thanks in advance, Sandy |
Ads |
#2
|
|||
|
|||
![]()
If the mailbox is opened as part of your profile you can get the folder you
want, access it's Items collection and handle ItemAdd just as you would with an Items collection in your own mailbox. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm wrote in message oups.com... Hi All, Just getting started with Outlook and VBA and am wondering if this is possible. I can write a macro that will monitor my Mailbox for incoming mails, but I would like to monitor another mailbox and have it alert me when a new message arives. e.g. We have an IT malbox that myself and someone else monitors. If we are not at our desk when a new message arrives, we are not alerted. I would like a message box to permanently be displayed when a new mail message arrives in the IT mailbox. Hope someone can point me in the right direction Thanks in advance, Sandy |
#3
|
|||
|
|||
![]()
Hi Ken,
Can you give me quick example of the code to do this. Failing that, can you point me to some info on the web about this. Thanks in advance, Sandy Ken Slovak - [MVP - Outlook] wrote: If the mailbox is opened as part of your profile you can get the folder you want, access it's Items collection and handle ItemAdd just as you would with an Items collection in your own mailbox. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm wrote in message oups.com... Hi All, Just getting started with Outlook and VBA and am wondering if this is possible. I can write a macro that will monitor my Mailbox for incoming mails, but I would like to monitor another mailbox and have it alert me when a new message arives. e.g. We have an IT malbox that myself and someone else monitors. If we are not at our desk when a new message arrives, we are not alerted. I would like a message box to permanently be displayed when a new mail message arrives in the IT mailbox. Hope someone can point me in the right direction Thanks in advance, Sandy |
#4
|
|||
|
|||
![]()
The ItemAdd event handler would have to be placed in a class module or the
default ThisOutlookSession class module (or in a VBA UserForm). This assumes use in ThisOutlookSession: Private WithEvents colItems As Outlook.Items Private Sub Application_Startup() Dim oTop As Outlook.MAPIFolder Dim oFolder As Outlook.MAPIFolder Dim oNS As Outlook.NameSpace Set oNS = Application.GetNameSpace("MAPI") 'change the mailbox name to whatever it is. Set oTop = oNS.Folders.Item("Mailbox - IT") Set oFolder = oTop.Folders.Item("Inbox") Set colItems = oFolder.Items End Sub Private Sub colItems_ItemAdd(ByVal Item As Object) 'whatever End Sub -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm wrote in message oups.com... Hi Ken, Can you give me quick example of the code to do this. Failing that, can you point me to some info on the web about this. Thanks in advance, Sandy |
#5
|
|||
|
|||
![]()
Thanks a lot Ken, all works fine now.
Cheers Ken Slovak - [MVP - Outlook] wrote: The ItemAdd event handler would have to be placed in a class module or the default ThisOutlookSession class module (or in a VBA UserForm). This assumes use in ThisOutlookSession: Private WithEvents colItems As Outlook.Items Private Sub Application_Startup() Dim oTop As Outlook.MAPIFolder Dim oFolder As Outlook.MAPIFolder Dim oNS As Outlook.NameSpace Set oNS = Application.GetNameSpace("MAPI") 'change the mailbox name to whatever it is. Set oTop = oNS.Folders.Item("Mailbox - IT") Set oFolder = oTop.Folders.Item("Inbox") Set colItems = oFolder.Items End Sub Private Sub colItems_ItemAdd(ByVal Item As Object) 'whatever End Sub -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm wrote in message oups.com... Hi Ken, Can you give me quick example of the code to do this. Failing that, can you point me to some info on the web about this. Thanks in advance, Sandy |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Open another users mailbox within my Outlook | MS User2006 | Outlook - General Queries | 2 | July 14th 06 06:30 PM |
How do I open a folder in another users mailbox? | Higgsy | Outlook and VBA | 2 | July 10th 06 04:46 PM |
Multiple users of same account and mailbox | [email protected] | Outlook - General Queries | 2 | April 19th 06 10:57 AM |
How to monitor Outlook 2003 performance/health | Sergio | Outlook - General Queries | 0 | January 27th 06 09:21 PM |
Monitor/troubleshoot Outlook | [email protected] | Outlook - General Queries | 0 | January 26th 06 08:23 PM |