Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Outlook - General Queries (http://www.outlookbanter.com/outlook-general-queries/)
-   -   Outgoing rule on BCC (http://www.outlookbanter.com/outlook-general-queries/33878-outgoing-rule-bcc.html)

[email protected] November 27th 06 04:08 PM

Outgoing rule on BCC
 
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


Sue Mosher [MVP-Outlook] November 27th 06 04:19 PM

Outgoing rule on BCC
 
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
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

wrote in message ups.com...
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


[email protected] November 27th 06 10:25 PM

Outgoing rule on BCC
 
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

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

On Nov 27, 10:19 am, "Sue Mosher [MVP-Outlook]"
wrote:
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
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

wrote in oglegroups.com...
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




All times are GMT +1. The time now is 12:58 PM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com