Solved

Create Outlook Macro to define sender, reply-to and signature

Posted on 2011-02-25
3
1,106 Views
Last Modified: 2012-05-11
Hi,

I'm looking for a macro that in one-click would

- set the From field to a specific email address
- add a specific recipient in the CC:
- set the reply-to field to a specific email address
- insert a defined signature

Ideally the macro would allow multiple "profiles" and would prompt which profile to use when invoking the macro.
Example:

Profile 1 :
- set From: to address1@email.com
- add "addressABC@email.com" in CC:
- set reply-to address1@swift.com
- replace current signature with Sig1

Profile 2 :
- set From: to address2@swift.com
- add "addressABC@email.com" in CC:
- set reply-to address2@swift.com
- replace current signature with Sig2

and so on...

Is this something possible ?
0
Comment
Question by:CCBelux
[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
3 Comments
 
LVL 76

Accepted Solution

by:
David Lee earned 500 total points
ID: 34985635
Hi, CCBelux.

Yes, that's possible.  These two procedures will do everything but the signatures.  Once we have the signature issue worked  out in the other question we can use it here to add the signature.
Sub Profile1()
    Dim olkMsg As Outlook.MailItem, olkRcp As Outlook.Recipient
    Set olkMsg = Application.ActiveInspector.CurrentItem
    With olkMsg
        .SentOnBehalfOfName = "address1@email.com"
        Set olkRcp = .Recipients.Add("addressABC.email.com")
        olkRcp.Type = olCC
        .ReplyRecipients.Add "address1@swift.com"
        .Save
    End With
End Sub

Sub Profile2()
    Dim olkMsg As Outlook.MailItem, olkRcp As Outlook.Recipient
    Set olkMsg = Application.ActiveInspector.CurrentItem
    With olkMsg
        .SentOnBehalfOfName = "address2@swift.com"
        Set olkRcp = .Recipients.Add("addressABC.email.com")
        olkRcp.Type = olCC
        .ReplyRecipients.Add "address2@swift.com"
        .Save
    End With
End Sub

Open in new window

0
 

Author Closing Comment

by:CCBelux
ID: 34995887
Thanks a lot it worked like a charm.
What would be the value to add should I wish the macro to set a category as well ?
0
 
LVL 76

Expert Comment

by:David Lee
ID: 35002392
You're welcome.  To add one or more categories, insert the following line of code anywhere between the WITH ... END WITH lines.

.Categories = "Category1,Category 2"
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Outlook Free & Paid Tools
Large Outlook files lead to various unwanted errors and corruption issues. Furthermore, large outlook files can also make Outlook take longer to start-up, search, navigate, and shut-down. So, In this article, i will discuss a method to make your Out…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Many of my clients call in with monstrous Gmail overloading issues with Outlook. A quick tip is to turn off the All Mail and Important folders from synching. Here is a quick video I made to show you how to turn off these and other folders in Gmail s…

733 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