Solved

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

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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Suggested Solutions

Learn more about how the humble email signature can be used as more than just an electronic business card. When used correctly, a signature can easily be tailored for different purposes by different departments within an organization.
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.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

914 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now