Sharper1989
Member
- Outlook version
- Outlook 2016 32 bit
- Email Account
- Exchange Server
I have some VBA set up which monitors a shared mailbox inbox & on inbox_add & adds a reminder 7 days in the future.
Unfortunately I've since realized that reminders don't fire when on a shared mailbox, so I was hoping that I could find some further VBA which would monitor the inbox of the shared mailbox, creates the reminder in the shared mailbox's task list AND copies that task/reminder into the individual user's task list.
So the reminder will then fire from their personal mailbox's task list. I'd also like it retained in the shared mailbox task list, even if the reminder doesn't fire.
Essentially the native Outlook functionality "Copy to My Calendar" only for Tasks/ Reminders & also through VBA.
Public Sub Application_Startup()
Dim objNS As NameSpace
Set objNS = Application.Session
Set OlItems = GetFolderPath("ExampleSharedMailbox").Items
Set objNS = Nothing
End Sub
Public Sub OlItems_ItemAdd(ByVal Item As Object)
Dim obApp As Application
Set obApp = Outlook.Application
If Item.Class = olMail And (LCase(Item.Subject) Like "*invoic*" Or LCase(Item.Body) Like "*invoic*") And Item.Attachments.Count > 0 And
With Item
.Categories = "Awaiting Dunning"
.ReminderSet = True
ReminderTime = Format(Date + 7 & " 2:00 PM", "ddddd h:nn AMPM")
.MarkAsTask
.Save
End With
End If
Set obApp = Nothing
End Sub
Do you know what VBA I can add to the "With Item" clause so not only does it add the Task/Reminder to the Shared mailbox, but copies it to the personal mailbox of the user as well?
I'm not worried about overwhelming the user's personal task list - not much will go through this mailbox.
Many thanks for any help!
Unfortunately I've since realized that reminders don't fire when on a shared mailbox, so I was hoping that I could find some further VBA which would monitor the inbox of the shared mailbox, creates the reminder in the shared mailbox's task list AND copies that task/reminder into the individual user's task list.
So the reminder will then fire from their personal mailbox's task list. I'd also like it retained in the shared mailbox task list, even if the reminder doesn't fire.
Essentially the native Outlook functionality "Copy to My Calendar" only for Tasks/ Reminders & also through VBA.
Public Sub Application_Startup()
Dim objNS As NameSpace
Set objNS = Application.Session
Set OlItems = GetFolderPath("ExampleSharedMailbox").Items
Set objNS = Nothing
End Sub
Public Sub OlItems_ItemAdd(ByVal Item As Object)
Dim obApp As Application
Set obApp = Outlook.Application
If Item.Class = olMail And (LCase(Item.Subject) Like "*invoic*" Or LCase(Item.Body) Like "*invoic*") And Item.Attachments.Count > 0 And
With Item
.Categories = "Awaiting Dunning"
.ReminderSet = True
ReminderTime = Format(Date + 7 & " 2:00 PM", "ddddd h:nn AMPM")
.MarkAsTask
.Save
End With
End If
Set obApp = Nothing
End Sub
Do you know what VBA I can add to the "With Item" clause so not only does it add the Task/Reminder to the Shared mailbox, but copies it to the personal mailbox of the user as well?
I'm not worried about overwhelming the user's personal task list - not much will go through this mailbox.
Many thanks for any help!