Solved

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

Posted on 2010-09-01
5
963 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
[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
  • 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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
This article will help to fix the below errors for MS Exchange Server 2013 I. Certificate error "name on the security certificate is invalid or does not match the name of the site" II. Out of Office not working III. Make Internal URLs and Externa…
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: …
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

622 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