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

Monitor another users Mailbox for new mail



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old August 8th 06, 08:54 AM posted to microsoft.public.outlook.program_vba
[email protected]
external usenet poster
 
Posts: 3
Default Monitor another users Mailbox for new mail

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  
Old August 8th 06, 02:05 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Monitor another users Mailbox for new mail

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  
Old August 15th 06, 11:55 AM posted to microsoft.public.outlook.program_vba
[email protected]
external usenet poster
 
Posts: 3
Default Monitor another users Mailbox for new mail

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  
Old August 15th 06, 02:15 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Monitor another users Mailbox for new mail

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  
Old August 16th 06, 01:57 PM posted to microsoft.public.outlook.program_vba
[email protected]
external usenet poster
 
Posts: 3
Default Monitor another users Mailbox for new mail

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


All times are GMT +1. The time now is 10:27 AM.


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.