Shared Mailbox Alert

Status
Not open for further replies.

shodan01

Member
Outlook version
Outlook 2010 64 bit
Email Account
Exchange Server
Process items in a shared mailbox

I want to setup a desktop or a sound alert to the message that comes into my shared folder.
I tried this macro, but I've got an error message. The first line became yellow if i tried to run it.
And the GetFolderPath wrong. I used my Mailbox name in this form - > ("**********\Inbox")
Whats the problem???

Private WithEvents olInboxItems As Items

Private Sub Application_Startup()
Dim objNS As NameSpace
Set objNS = Application.Session

' Get function from Working with VBA and non-default Outlook Folders
Set olInboxItems = GetFolderPath("Mailbox name in folder list\Inbox").Items
Set objNS = Nothing
End Sub

Private Sub olInboxItems_ItemAdd(ByVal Item As Object)
On Error Resume Next

Item.Categories = "My Category"
Item.Save
Set myForward = Item.Forward
'this puts the name in the To field
myForward.Recipients.Add "me@domain.com"
myForward.Display ' use .Send to send it automatically


End Sub
 
is the shared inbox open in your profile as part of the mailbox or just as a folder? Can see all of the folders in the shared mailbox in the Folder list or did you open the folder using Open > other users folder? How you opened it controls the code you need to watch it.
 
It is a part of the mailbox, not just a folder. I will upload some screenshot tomorrow. Thanks!
 
Hi,
You can test it

If you want an alert it's better using an Userform (vbmodeless) than Msgbox

Code:
Private WithEvents olInboxItems As Items

Private Sub Application_Startup()
Dim objNS As NameSpace
Set objNS = Application.Session

' Get function from Working with VBA and non-default Outlook Folders
Set olInboxItems = objNS.folders("Mailbox name in folder list").folders("Inbox").Items
Set objNS = Nothing
End Sub

Private Sub olInboxItems_ItemAdd(ByVal Item As Object)
On Error Resume Next

Msgbox Item

End Sub
 
Thank you! I will try that, anyway this is how my mailbox looklike...
nt8Z1sC.jpg


I want to setup, when i got a mail for the second mailbox inbox, outlok show me an alert desktop notif.
 
But i unable to make sound. The msgbox trigger the default "beep" sound in windows if i know well, but i cant hear anything. In the control panel/sound /sounds activated.
Can i change msgbox to critical? maybe it has sounds. How can i do that in this example?
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
M Outlook 2016 outlook vba to look into shared mailbox Outlook VBA and Custom Forms 0
S Email Macros to go to a SHARED Outlook mailbox Draft folder...NOT my personal Outlook Draft folder Using Outlook 2
C Outlook 365 Multiple different Signatures on Shared Mailbox Using Outlook 0
S Outlook 365 Shared mailbox contact group member numbers not matching Using Outlook 0
S Copy Tasks/Reminders from Shared Mailbox to Personal Tasks/Reminders Outlook VBA and Custom Forms 0
R Assign Categories "Round Robin" style but in a shared mailbox but on specific emails only Outlook VBA and Custom Forms 8
P Auto assign shared mailbox Outlook VBA and Custom Forms 1
R VBA for copying sent email to current folder under a shared mailbox Outlook VBA and Custom Forms 17
A New email notification on shared mailbox Outlook VBA and Custom Forms 0
N Shared mailbox in cached mode Using Outlook 0
B Vba to monitor time to respond to emails using a shared mailbox Outlook VBA and Custom Forms 5
D Shared Mailbox question Exchange Server Administration 1
S Import contacts to a shared mailbox Outlook VBA and Custom Forms 2
D Delete Emails from Senders in Shared Mailbox Outlook VBA and Custom Forms 1
C Changed By field not displaying individual user's name in O365 Shared Mailbox Using Outlook 9
S Recovering permanently deleted folder from shared mailbox Using Outlook 1
I Application_NewMailEx for shared mailbox Outlook VBA and Custom Forms 1
Mark White vba to create a shared mailbox folder Outlook VBA and Custom Forms 3
D VBA macro printing attachments in shared mailbox Outlook VBA and Custom Forms 1
oliv- Treat once an email with the ItemAdd event in a shared mailbox Outlook VBA and Custom Forms 2
K VBA to measure response time for each emails in a shared mailbox Outlook VBA and Custom Forms 11
O VBA rule on multiple computers using shared mailbox Outlook VBA and Custom Forms 1
D Shared Mailbox with mail item marked as "private" Using Outlook 0
Diane Poremsky Save Sent Items in Shared Mailbox using an Exchange Server Cmdlet Using Outlook 0
J Automatically Move Old Items from a Shared Mailbox to a .PST on a Network Drive Outlook VBA and Custom Forms 1
Van Fog Get items in search folder for shared mailbox Outlook VBA and Custom Forms 3
I shared mailbox - can i create a rule (vba) for every user? Outlook VBA and Custom Forms 1
Diane Poremsky How to View Shared Subfolders in an Exchange Mailbox Using Outlook 0
R How do I 'Save Copy of Sent Item to Folder' for a Shared Mailbox Outlook VBA and Custom Forms 9
E Searching a Shared Outlook Mailbox from the start menu? Using Outlook 4
T Messages no longer move to quote folder on shared mailbox after user adds -D to folder name Outlook VBA and Custom Forms 1
Jack Farnan ShowCategoriesDialog for a shared mailbox? Outlook VBA and Custom Forms 3
J Calender notifications from a shared generic mailbox. Using Outlook 1
B Create appointment/meeting from shared mailbox Using Outlook 2
E Shared Mailbox - Send Items Using Outlook 1
B quick help with "changed by" field in a shared mailbox?? Using Outlook 3
R View who sent on behalf of a shared mailbox in Outlook sent items Using Outlook 1
N How to know the email sender (windows logon profile) from a Shared Mailbox Using Outlook 2
L Shared Mailbox, 2 Auto Responses Using Outlook 3
D Shared Mailbox Using Outlook 1
H Forward from Shared Mailbox to individual folders Using Outlook 6
J Color categories with shared mailbox Using Outlook 1
C Tracking WHO deleted items in a Shared Mailbox Using Outlook 1
K Prevent meeting requests being sent from a shared calendar in a group mailbox Using Outlook 1
L Editing auto reply email from a shared mailbox? Exchange Server Administration 7
H Moving emails in shared mailbox to personal mailbox Exchange Server Administration 0
J Add categories to Shared Mailbox using VBA Using Outlook 2
D VBA code running on Server? Shared mailbox email routing Using Outlook 3
N Mark or follow up emails in shared mailbox Using Outlook 2
C Outllook Migration - Office 200? - 2010 - Shared Mailbox Export-Bulk 500 users Using Outlook 1

Similar threads

Back
Top