In online mode the following code works like I'd expect...saving a sent item in the correct mailbox's sent items folder.
(sorry if the code isn't formatted right, this is my first post here)
The problem I'm having is that most users here are running in cached mode. When running in cached mode, this code leaves an "unread" message in the outbox (though the message IS delivered). And once in the outbox....unless I/the user drags and drops it elsewhere...it never moves.
I can duplicate this on my machine.
I've also tried using the "pickfolder" method, but that also doesn't seem to help.
So how do I redirect where the sent item is saved in Cached mode?
Thanks!
(sorry if the code isn't formatted right, this is my first post here)
Code:
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim mboxName As String
Dim objNS As Outlook.NameSpace
Set objNS = Application.GetNamespace("MAPI")
If Not objNS.CurrentUser Is Nothing Then
strAddresses = objNS.CurrentUser
Else
MsgBox ("Error: 001 - Please contact <name> to find out why this script is not running right.")
End If
If Item.SentOnBehalfOfName <> "" Then
If Item.SentOnBehalfOfName <> strAddresses Then
Dim myFolder As folder
Dim NewSentItems As folder
mboxName = Item.SentOnBehalfOfName
Set myFolder = objNS.Folders("Mailbox - " & mboxName)
Set NewSentItems = myFolder.Folders("Sent Items")
Set Item.SaveSentMessageFolder = NewSentItems
Set myFolder = Nothing
Set NewSentItems = Nothing
Else
'Do nothing
End If
End If
Set objNS = Nothing
Set golApp = Nothing
Set objSession = Nothing
Set objAddressEntry = Nothing
End Sub
The problem I'm having is that most users here are running in cached mode. When running in cached mode, this code leaves an "unread" message in the outbox (though the message IS delivered). And once in the outbox....unless I/the user drags and drops it elsewhere...it never moves.
I can duplicate this on my machine.
I've also tried using the "pickfolder" method, but that also doesn't seem to help.
So how do I redirect where the sent item is saved in Cached mode?
Thanks!