'On the next two lines edit the names/addresses. The former is the name/address of the account you are sending for, the latter is the address to forward to.'
Const SENT_FOR = "John Doe"
Const FWD_TO = "firstname.lastname@example.org"
Private WithEvents olkWatchedFolder As Outlook.Items
Private Sub Class_Initialize()
Set olkWatchedFolder = Outlook.Application.Session.GetDefaultFolder(olFolderSentMail).Items
Private Sub Class_Terminate()
Set olkWatchedFolder = Nothing
Private Sub olkWatchedFolder_ItemAdd(ByVal Item As Object)
Dim olkFwd As Outlook.MailItem
If Item.Class = olMail Then
If Item.SentOnBehalfOfName = SENT_FOR Then
Set olkFwd = Item.Forward
olkFwd.To = FWD_TO
Set olkFwd = Nothing
Open in new window
Private objAF As AutoForward
Private Sub Application_Quit()
Set objAF = Nothing
Private Sub Application_Startup()
Set objAF = New AutoForward
If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.