Help with changing Font on Outlook reply macro

Cole Logan 0 Reputation points
2023-11-01T20:35:56.2866667+00:00
Hello, I was able to get this macro working but once I try to add in the <br> to have certain words skip to a different line

the font changes. Can some one help me with adding in the code to change the font? Thanks

Sub AutoAddGreetingtoReply() 

    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 

  

    Select Case Time 

           Case 0.3 To 0.5 

                GreetTime = "Good morning" 

           Case 0.5 To 0.75 

                GreetTime = "Good afternoon" 

           Case Else 

                GreetTime = "Good evening" 

    End Select 

  

    Set oReply = oMail.Reply 

  

    With oReply 

         

.HTMLBody = "</HTML></Body>" & GreetTime & " <br>All set for delivery on " & Format(Date + 2, "dddd, mm /dd/            yyyy") & " <br><br>Thanks!" & vbCrLf & .HTMLBody 

         .Display 

    End With 

End Sub 


Microsoft 365 and Office Development Other
Outlook Windows Classic Outlook for Windows For business
{count} votes

1 answer

Sort by: Most helpful
  1. Cole Logan 0 Reputation points
    2023-11-02T11:39:40.9866667+00:00

    Ok any help is appreciated, thanks!

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.