Solved

Forward an Email when it is sent FROM a specific address

Posted on 2011-09-06
5
319 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
[X]
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
  • 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 81

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

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Lotus Notes – formerly IBM Notes – is an email client application, while IBM Domino (earlier Lotus Domino) is an email server. The client possesses a set of features that are even more advanced as compared to that of Outlook. Likewise, IBM Domino is…
This article explains how to install and use the NTBackup utility that comes with Windows Server.
To show how to generate a certificate request in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.:  First we need to log into the Exchange Admin Center. Navigate to the Servers >> Certificates…
how to add IIS SMTP to handle application/Scanner relays into office 365.

738 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