reubendayal
Senior Member
- Outlook version
- Outlook 365 64 bit
- Email Account
- Office 365 Exchange
Hi There,
I have the below code in my ThisOutlookSession, and I am trying to copy the email I am sending from a current folder (a sub folder under a shared mailbox). I have prepared the below code after referring several similar discussions online. But the code doesnt seem to do as desired.
The sent emails go to my official email's sent folder and nothing ever gets saved in the sent folder of the shared mailbox.
Thanks for your help!
I have the below code in my ThisOutlookSession, and I am trying to copy the email I am sending from a current folder (a sub folder under a shared mailbox). I have prepared the below code after referring several similar discussions online. But the code doesnt seem to do as desired.
The sent emails go to my official email's sent folder and nothing ever gets saved in the sent folder of the shared mailbox.
Thanks for your help!
Code:
Private Sub Application_ItemSend(ByVal Response As Object, Cancel As Boolean)
Dim objOL As New Outlook.Application
Dim MyActiveFolder As Outlook.MAPIFolder
Dim CuFolder As String
Set objOL = CreateObject("Outlook.Application")
Set MyActiveFolder = objOL.ActiveExplorer.CurrentFolder
CuFolder = MyActiveFolder.Name
MsgBox CuFolder
If CuFolder <> "Inbox" Then
Dim myItem As MailItem
Set myItem = Application.ActiveInspector.CurrentItem
Set Response.SaveSentMessageFolder = myItem.Parent
Else
End If
End Sub