3

It appears that when sending mail, the rule I use to move the sent item to another mailbox' sent items folder isn't processed. If I manually use the "process rules now" button it works as expected.

Is there any way to:

  • put these sent items directly into the mailbox when using "send as", without rules

  • if rules need to be used, how do I make sure they are processed right after sending the mail

2 Answers 2

1

I don't think you can automate that, since rules are designed to run before email is delivered, not before sent mail is processed.

The only other options are to manually trigger the rule (as you've already stated) or create a macro that does the move, and assign the macro to a button on the toolbar. Although that would be easier to initiate, it would be much harder to design the macro to do what you want.

3
  • could you elaborate on the macro's, please? Aug 24, 2010 at 8:03
  • ureader.com/msg/1081942.aspx
    – Tom
    Aug 24, 2010 at 15:01
  • I see, well that wouldn't help me much as 1) it'd be a PITA to get it to work as you said, and 2) I could just as well make a rule to do it and then press the "process rules" after sending, instead of pressing the macro button, so it wouldn't really improve much (if at all) Aug 25, 2010 at 7:49
0

Use the Sent Items folder's "ItemAdd" event instead of MailItem's "Send" event.

I found this post by Rob Gravelle explaining why it is easier to use the event of an email being added to "Sent Items" as a trigger.

Gravelle provides this sample VBA script that moves the Sent item to "FOSS Export (CR-035)" if the recipient address contains "RobGravelleAndCo.com":

Option Explicit

Public WithEvents oSentItems As Items
Private oBusinessFolder As MAPIFolder
Private Const BUSINESS_FOLDER = "FOSS Export (CR-035)"
Private Const PARTNER_EMAIL_ADDRESS = "RobGravelleAndCo.com"
    
Private Sub Application_Startup()
    Dim oSentItemsFolder As MAPIFolder  
    Set oSentItemsFolder = Application.Session.GetDefaultFolder(olFolderSentMail)
    Set oSentItems = oSentItemsFolder.Items
    Set oBusinessFolder = oSentItemsFolder.Parent.Folders(BUSINESS_FOLDER)
End Sub
    
Private Sub oSentItems_ItemAdd(ByVal item As Object)
    Dim oRecipient As Recipient
    Select Case item.Class
        Case olMail, olMeetingRequest
        For Each oRecipient In item.Recipients
            If InStr(1, oRecipient.Address, PARTNER_EMAIL_ADDRESS) Then
                item.Move oBusinessFolder
                Exit For
            End If
        Next
    End Select
End Sub

I wanted Outlook to choose the Sent Items folder based on the "From" field, instead of the "To" field. I modified Gravelle's script into a VSTO add-in that prompts for a "Sent Items" folder each time you use a new "From" address. I posted the source code on GitHub if anyone wants to try it or fork it:

SentFolderByFrom

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .