Solved

Forward an Email when it is sent FROM a specific address

Posted on 2011-09-06
5
320 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 82

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

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

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

How to resolve IMCEAEX NDRs in Exchange or Exchange Online related to invalid X500 addresses.
Mailbox Overload?
The basic steps you have just learned will be implemented in this video. The basic steps are shown to configure an Exchange DAG in a live working Exchange Server Environment and manage the same (Exchange Server 2010 Software is used in a Windows Ser…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses

623 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