Setting the font of the message body

V

Vaelek

Hi!

I am developing an extensibility add-on. I create a MailItem, populate some
fields and throw some text in the body. The problem is that while the text I
insert into the body is in Arial font, if I type additional text into the
message body it is using Times New Roman. All of my default fonts are set to
Arial in the settings and I cannot for the life of me find any way to set the
font on text added to the message body. Any help is greatly appreciated.

Thanks!
 
K

Ken Slovak - [MVP - Outlook]

What version of Outlook? What message format? If this is HTML are you adding
the text within HTML formatting tags? How are you adding the text? Is
WordMail involved?
 
V

Vaelek

This is Outlook 2003. I am using HTML format but I do not use any tags.
My function looks as such:

Outlook.ApplicationClass olApp = new ApplicationClass();
Outlook.MailItem mailitem =
(Outlook.MailItem)olApp.CreateItem(Outlook.OlItemType.olMailItem);
mailitem.BodyFormat = OlBodyFormat.olFormatHTML;

mailitem.Subject = "Incident ";
mailitem.Body = "\r\n\r\n\r\n\r\nRegards,\r\n\r\n" + _client.Signature;
mailitem.SentOnBehalfOfName = _client.SupportAddress;
mailitem.BCC = "(e-mail address removed)";
mailitem.Importance = Outlook.OlImportance.olImportanceNormal;
mailitem.Display(false);

All the text populated in the above code is in Arial font. If I place the
cursor above the text and start typing, it switches to Times New Roman. The
issue isn't so much that I want to specify the font, I would just like the
entire body to be consistent, eg Arial.
 
K

Ken Slovak - [MVP - Outlook]

You really should be working with HTMLBody in that case and inserting your
text either inside existing formatting tags or using your own formatting
tags.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top