Solved

Keep default Font in Macro for replies in HTML to Plain Text emails

Posted on 2010-09-01
5
954 Views
Last Modified: 2012-05-10
Hi there,
I'm using this piece of code I got from http://outlook-tips.net/cs/blogs/outlooktips/archive/2007/08/02/671.aspx

_____________________________

Option Explicit

Private WithEvents oExpl As Explorer
Private WithEvents oItem As MailItem

Private bDiscardEvents As Boolean
Private olFormat As OlBodyFormat


Private Sub Application_Startup()
   
   Set oExpl = Application.ActiveExplorer
   
   bDiscardEvents = False
   olFormat = olFormatHTML
End Sub

Private Sub oExpl_SelectionChange()

   On Error Resume Next
   Set oItem = oExpl.Selection.Item(1)
   
End Sub
Private Sub oItem_Reply(ByVal Response As Object, Cancel As Boolean)

   If bDiscardEvents Or oItem.BodyFormat = olFormat Then
       Exit Sub
   End If
   
  Cancel = True

  bDiscardEvents = True
  Dim oResponse As MailItem
  Set oResponse = oItem.Reply
  oResponse.Display
  oResponse.BodyFormat = olFormat
   
 bDiscardEvents = False
   
End Sub
Private Sub oItem_ReplyAll(ByVal Response As Object, Cancel As Boolean)

   If bDiscardEvents Or oItem.BodyFormat = olFormat Then
       Exit Sub
   End If

   Cancel = True
 
   bDiscardEvents = True
   
   Dim oResponse As MailItem
   Set oResponse = oItem.ReplyAll
   oResponse.Display
   oResponse.BodyFormat = olFormat
   
   bDiscardEvents = False
   
End Sub
Private Sub oItem_Forward(ByVal Forward As Object, Cancel As Boolean)
   
   If bDiscardEvents Or oItem.BodyFormat = olFormat Then
       Exit Sub
   End If
   
   Cancel = True

   bDiscardEvents = True
   
   Dim oResponse As MailItem
   Set oResponse = oItem.Forward
   oResponse.Display
   oResponse.BodyFormat = olFormat
   
   bDiscardEvents = False
   
End Sub

____________________________

that converts  to html when you reply to a plain text message. It works good, but I have an issue with the fonts, I have all my fonts set to Calibri, and a signature, and it always changes to Time new roman.  Now it does change the font even when I reply to HTML emails
Could anyone advice me how to change this code to keep my default font selection whenever I reply to a message?

Thanks for your time!
Andres Iniesta.
0
Comment
Question by:japinrem
  • 3
  • 2
5 Comments
 
LVL 28

Expert Comment

by:peakpeak
ID: 33589147
0
 

Author Comment

by:japinrem
ID: 33594475
@peakpeak
Yes, I do have all that configurations set up in my account, If I don´t use the macro code above my emails use the fonts I have configured, but when I reply to a plain text message, this is made in plain text as well.
To change that behaviour I tried the macro, and It works generating a reply in HTML format, but changing at the same time my fonts to Time New Roman.

So, maybe this can't be changed inside the macro, at least my VBA skills aren´t good enough to do it.
0
 
LVL 28

Accepted Solution

by:
peakpeak earned 500 total points
ID: 33594525
If you choose HTML format for the replies you can always put
<div><style="font-family:Calibri;"> .... (your text) ... </div>
as the body in the message
0
 

Author Comment

by:japinrem
ID: 33596155
I'm sorry, I don't follow you, where do I use that piece of HTML? Sorry.
0
 
LVL 28

Expert Comment

by:peakpeak
ID: 33596596
As the text
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Read this checklist to learn more about the 15 things you should never include in an email signature.
Many people use more than one email account and so it becomes difficult for them to manage them when they use separate accounts,  so, in this article, I have shared an easy way to add Other Mail Accounts in your Google Inbox. It helps to combine all…
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …
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: …

740 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