Automatic Add to Group Address

  • Thread starter Thread starter jbento
  • Start date Start date
J

jbento

I am using Microsoft Outlook 2002.

I have a rule set up when certain words in the subject would go to
specific folder.

I would like to also have that set up where the email address in th
From: line would automatically be added to a group address that I se
up.

Does anyone know how to do this?

Any help would be appreciated.

Thanks in advance
 
Your best bet is to write VBA code to handle this scenario instead of the
Rules Wizard.

Create a class called clsMyRules in your VBA project and use the following
code as a template to get you started:

Option Explicit
Dim WithEvents NewMailItems As Outlook.Items

Private Sub Application_Quit()
Set NewMailItems = Nothing
End Sub

Private Sub Application_Startup()
Set NewMailItems =
Application.GetNamespace("MAPI").GetDefaultFolder(olFolderInbox).Items
End Sub

Private Sub NewMailItems_ItemAdd(ByVal Item As Object)
'THIS WILL FIRE FOR EVERY NEW E-MAIL; YOU CAN USE THE
'Item OBJECT TO WORK WITH THE PROPERTIES OF THE E-MAIL MESSAGE

End Sub

You'd need to create a new instance of this class in the
Application_Startup() event of the ThisOutlookSession module.

Also, look at http://www.slipstick.com/dev/code/getsenderaddy.htm to see how
you can retrieve the sender's e-mail message. Then add your final code to
add this address to your distribution list.
 
Back
Top