Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Forward an Email when it is sent FROM a specific address

Posted on 2011-09-06
5
317 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 80

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

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
This article lists the top 5 free OST to PST Converter Tools. These tools save a lot of time for users when they want to convert OST to PST after their exchange server is no longer available or some other critical issue with exchange server or impor…
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…
This video demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to: http://www.codetwo.com/excha…

809 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