Outgoing rule on BCC

K

kevin.bourque

I'm trying to set up a rule to move all messages that I send which have
specific names in the BCC field.
This is an outbound mail rule (i.e. "Check messages after sending" in
the new rules creation wizzard), so I can see who I'm sending to in
each of the fields (To, CC, and BCC). The rules wizzard allows for
watching rules sent through a specific account, but I cannot see how to
filter the BCC field.

Any help would be appreciated. If this is not possible through the
wizzard, I am willing to program this with VBA; however, any pointers
to which objects in the Outlook DOM would be greatly appreciated!

(PS. I'll post all code I develop for this back here and/or on
microsoft.public.outlook.vba)

Kind regards,
Kevin
 
S

Sue Mosher [MVP-Outlook]

You would have to code this in VBA. Use the Application_ItemSend event, which passes the outgoing item as a parameter. The Recipients collection is exactly what the name implies. Check each Recipient.Type property to learn which is a Bcc. Or use the MailItem.Bcc property.

Also note that you can't move an item as it's being sent. You can, however, change the SaveSentMessageFolder property to point to a specific folder in the user's default store.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
K

kevin.bourque

Thank you very much. This is what I've come up with and it seems to
work pretty well. If you create a folder "FolderXYZ" or replace the
text with your own folder name, and replace "Doe, John" with how your
name appears when typed into a recipient field, this should work.

Enjoy,
Kevin

===============

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As
Boolean)
Dim objMailItem As MailItem
Dim objInbox As Outlook.MAPIFolder
Dim objFolder As Outlook.MAPIFolder

Set objInbox = Application.Session.GetDefaultFolder(olFolderInbox)
Set objFolder = objInbox.Folders("FolderXYZ")
Set objMailItem = Item

If objMailItem.BCC = "Doe, John" Then
Set objMailItem.SaveSentMessageFolder = objFolder
End If

Set objMailItem = Nothing
Set objInbox = Nothing
Set objFolder = Nothing

End Sub

=================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top