![]() |
#1
|
|||
|
|||
![]()
Good afternoon everyone,
I am coming to you as I am trying to write a code that adds simple greetings when replying to an email: "Hi (sender's first name)," I managed to get this code going and it works well, however my issue is the formatting, which I thought would have been an easy fix, however all my attempts failed... My code below: Code:
Sub AutoAddGreetingtoReplyAll() Dim oMail As MailItem Dim oReply As MailItem Dim GreetTime As String Select Case Application.ActiveWindow.Class Case olInspector Set oMail = ActiveInspector.currentItem Case olExplorer Set oMail = ActiveExplorer.Selection.Item(1) End Select Set oReply = oMail.Reply With oReply .HTMLBody = "Hi " & Split(oMail.SenderName)(0) & "," & .HTMLBody .Display End With End Sub Code:
.HTMLBody = "<span style='font-size:11.0pt;font-family:""Century Gothic"" '>Hi </span>" & Split(oMail.SenderName)(0) & "<span style='font-size:11.0pt;font-family:""Century Gothic"" '>,</span>" & .HTMLBody Cheers, Fabien |
Tags |
vba |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
Elly26 | Outlook | 5 | 02-22-2016 02:11 PM |
Outlook 2003 Problem if I forward/reply to a message, it says "at least one active x controll elemen | joe-msofficeforums | Outlook | 0 | 06-23-2015 04:51 AM |
Wrong email address being used for "From" address when I reply | Rosie Perera | Outlook | 0 | 04-20-2015 02:12 PM |
remove repeated words with " macro " or " wild cards " in texts with parentheses and commas | jocke321 | Word VBA | 2 | 12-10-2014 11:27 AM |
![]() |
Jamal NUMAN | Word | 2 | 07-03-2011 03:11 AM |