Solved

Forward an Email when it is sent FROM a specific address

Posted on 2011-09-06
5
314 Views
Last Modified: 2012-05-12
We have a user that has exchange permission to send as another user.

How can i get any emails sent my the user as the 2nd user to be automatically forwarded to another account?

I hope i have explained this propperly

Thanks in advance.

Outlook 2007
Exchange 2007
0
Comment
Question by:ict-torquilclark
  • 2
  • 2
5 Comments
 
LVL 76

Expert Comment

by:David Lee
ID: 36487615
Hi, ict-torquilclark.

I think I can do it with a macro.  Would that be acceptable?
0
 
LVL 1

Author Comment

by:ict-torquilclark
ID: 36487656
yes, would it store the macro in the users roaming profile so it would activate whereever he logged on?
0
 
LVL 76

Expert Comment

by:David Lee
ID: 36487745
I believe so, but that's more of a Windows question than an Outlook one and I'm not an expert on Windows and roaming profiles.  I should also mention that the macro will only work for the full Outlook client, not OWA.  

Here's the code I propose.  Since I don't have any delegates I'm not in a position to test it.  The code comes in two parts.  Follow these instructions to add them both to Outlook.

Part 1

1.  Start Outlook
2.  Click Tools > Macro > Visual Basic Editor
3.  If not already expanded, expand Microsoft Office Outlook Objects
4.  Right-click on Class Modules, select Insert > Class Module
5.  In the Properties panel click on Name and enter AutoForward
6.  Copy the code from the Code Snippet box and paste it into the right-hand pane of Outlook's VB Editor window
7.  Edit the code as needed.  I included comments wherever something needs to or can change
8.  Click the diskette icon on the toolbar to save the changes
9.  Close the VB Editor

'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 = "someone@company.com"

Private WithEvents olkWatchedFolder As Outlook.Items

Private Sub Class_Initialize()
    Set olkWatchedFolder = Outlook.Application.Session.GetDefaultFolder(olFolderSentMail).Items
End Sub

Private Sub Class_Terminate()
    Set olkWatchedFolder = Nothing
End Sub

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
            olkFwd.Send
        End If
    End If
    Set olkFwd = Nothing
End Sub

Open in new window


Part 2

1.  Start Outlook
2.  Click Tools > Macro > Visual Basic Editor
3.  If not already expanded, expand Microsoft Office Outlook Objects and click on ThisOutlookSession
4.  Copy the code from the Code Snippet box and paste it into the right-hand pane of Outlook's VB Editor window
5.  Edit the code as needed.  I included comment lines wherever something needs to or can change
6.  Click the diskette icon on the toolbar to save the changes
7.  Close the VB Editor
8.  Click Tools > Trust Center
9.  Click Macro Security
10. Set Macro Security to "Warnings for all macros"
11. Click OK
12. Close Outlook

13. Start Outlook.  Outlook will display a dialog-box warning that ThisOutlookSession contains macros and asking if you want to allow them to run.  Say yes.

Private objAF As AutoForward

Private Sub Application_Quit()
    Set objAF = Nothing
End Sub

Private Sub Application_Startup()
    Set objAF = New AutoForward
End Sub

Open in new window

0
 
LVL 79

Accepted Solution

by:
David Johnson, CD, MVP earned 500 total points
ID: 36497540
or a simple outlook rule or a transport rule in exchange.
 Outlook rule.. as an attachment or not your option
0
 
LVL 1

Author Comment

by:ict-torquilclark
ID: 36503194
The exchange rule workes wondervully

I didnt know about those
0

Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Marketers need statistics and metrics like everybody else needs oxygen. In this article we explain how to enable marketing campaign statistics for Microsoft Exchange mail.
Are you unable to connect or configure Hotmail email account in Microsoft Outlook 2010, 2007? Or Outlook.com emails are not downloading to Outlook? Lets’ see the problem and resolve Outlook Connector error syncing folder hierarchy (0x8004102A).
In this video we show how to create a Resource Mailbox in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: Navigate to the Recipients >> Resources tab.: "Recipients" is our default selection …
In this Micro Video tutorial you will learn the basics about Database Availability Groups and How to configure one using a live Exchange Server Environment. The video tutorial explains the basics of the Exchange server Database Availability grou…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now