-
Nov 30th, 1999, 01:58 AM
#1
How do you set the font of a new email message? I'm using an outlook object to send email from my vb app, but I can't seem to change the font of the body of the message.
-
Nov 30th, 1999, 03:08 AM
#2
To use different Fonts/Sizes or Colors the Text you use for the Body of the Message needs to be in Rich-Text Format.
So you could use a RichTextbox to Create your Message in Whatever Format you require, then set the Messages Body Property to the RichTextbox's TextRTF Property, eg.
Code:
Private Sub Command1_Click()
Dim oOutLook As New Outlook.Application
Dim oMsg As Outlook.MailItem
Set oMsg = oOutLook.CreateItem(olMailItem)
oMsg.To = "Aaron Young"
With RichTextBox1
.Text = ""
.SelFontName = "Arial"
.SelFontSize = 48
.SelColor = vbBlue
.SelText = "Hi Aaron!!"
End With
oMsg.Body = RichTextBox1.TextRTF
oMsg.Send
End Sub
------------------
Aaron Young
Analyst Programmer
aarony@redwingsoftware.com
adyoung@win.bright.net
-
Nov 30th, 1999, 03:37 AM
#3
That was one of the first things I tried. After that I tried HTML elements, and changing the default font for new mail messages (I couldn't find that one from code).
None of these worked.
Your example produces a message like this:
{\rtf1\ansi\ansicpg1252\deff0\deftab720{\fonttbl{\f0\fswiss MS Sans Serif;}{\f1\froman\fcharset2 Symbol;}{\f2\fswiss Arial;}{\f3\fswiss MS Sans Serif;}}
{\colortbl\red0\green0\blue0;\red0\green0\blue255;}
\deflang1033\pard\plain\f2\fs96\cf1 Hi Aaron!!\plain\f3\fs17
\par }
If you have any other ideas, your welcome. Maybe using the MAPI object is an option.
Thanks anyway
[This message has been edited by Frans C (edited 11-30-1999).]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|