Solved

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

Posted on 2010-09-01
5
950 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this step by step procedure, you will come to know the details of creating an Outlook meeting in 2007, 2010, 2013 & 2016.
Many of my clients call in with monstrous Gmail overloading issues with Outlook. A quick tip is to turn off the All Mail and Important folders from synching. Here is a quick video I made to show you how to turn off these and other folders in Gmail s…
CodeTwo Sync for iCloud (http://www.codetwo.com/sync-for-icloud?sts=6554) automatically synchronizes your Outlook 2016, 2013, 2010 or 2007 folders with iCloud folders available via iCloud Control Panel. This lets you automatically sync them with…

776 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