Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SaveSentMessageFolder Outlook Cached mode vs. Online mode

Status
Not open for further replies.

masuka

Technical User
Sep 24, 2007
1
0
0
US
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)

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!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top