Hi all,
Firstly, as this is my first post (avid lurker), salutations to all!
I love this forum, it's provided me with many solutions and ideas, so thank you to all, regardless if my question is answered or not, you are all awesome.
My problem:
After doing much research on the Save Sent Item To (for shared mailboxes), I've now understand that the option is greyed out due to the change in the registry (DelegateSentItemsStyle). This enables the shared inbox to save sent messages to the shared inbox sent folder.
A work around for this was to have the Save Sent Item folder to prompt when an email is sent (using the below code).
However, I want the prompt to only display when the user is sending from a specific email address. I've attempted to use < If SenderEmailAddress = 'email@address.com' Then >however, this never triggers, no matter what I try.
Could anyone offer assistance with the below code (extracted from http://www.outlookcode.com/article.aspx?id=48)
Firstly, as this is my first post (avid lurker), salutations to all!
I love this forum, it's provided me with many solutions and ideas, so thank you to all, regardless if my question is answered or not, you are all awesome.
My problem:
After doing much research on the Save Sent Item To (for shared mailboxes), I've now understand that the option is greyed out due to the change in the registry (DelegateSentItemsStyle). This enables the shared inbox to save sent messages to the shared inbox sent folder.
A work around for this was to have the Save Sent Item folder to prompt when an email is sent (using the below code).
However, I want the prompt to only display when the user is sending from a specific email address. I've attempted to use < If SenderEmailAddress = 'email@address.com' Then >however, this never triggers, no matter what I try.
Could anyone offer assistance with the below code (extracted from http://www.outlookcode.com/article.aspx?id=48)
Code:
Private Sub Application_ItemSend(ByVal Item As Object, _
Cancel As Boolean)
Dim objNS As NameSpace
Dim objFolder As MAPIFolder
Set objNS = Application.GetNamespace("MAPI")
Set objFolder = objNS.PickFolder
If TypeName(objFolder) <> "Nothing" And _
IsInDefaultStore(objFolder) Then
Set Item.SaveSentMessageFolder = objFolder
End If
Set objFolder = Nothing
Set objNS = Nothing
End Sub
Public Function IsInDefaultStore(objOL As Object) As Boolean
Dim objApp As Outlook.Application
Dim objNS As Outlook.NameSpace
Dim objInbox As Outlook.MAPIFolder
On Error Resume Next
Set objApp = CreateObject("Outlook.Application")
Set objNS = objApp.GetNamespace("MAPI")
Set objInbox = objNS.GetDefaultFolder(olFolderInbox)
Select Case objOL.Class
Case olFolder
If objOL.StoreID = objInbox.StoreID Then
IsInDefaultStore = True
End If
Case olAppointment, olContact, olDistributionList, _
olJournal, olMail, olNote, olPost, olTask
If objOL.Parent.StoreID = objInbox.StoreID Then
IsInDefaultStore = True
End If
Case Else
MsgBox "This function isn't designed to work " & _
"with " & TypeName(objOL) & _
" items and will return False.", _
, "IsInDefaultStore"
End Select
Set objApp = Nothing
Set objNS = Nothing
Set objInbox = Nothing
End Function