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

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

Posted on 2011-02-25
3
1,105 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
  • 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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

Outlook Free & Paid Tools
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).
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

840 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