?
Solved

Changing the Font in an Outlook Mailitem

Posted on 2000-02-04
4
Medium Priority
?
1,550 Views
Last Modified: 2013-12-03
I am trying to change the font of an email i have generated in code buut i can't seem to find where i set the font.  does anyone have any ideas?

thanks.
0
Comment
Question by:rauchs
  • 2
  • 2
4 Comments
 
LVL 9

Accepted Solution

by:
Ruchi earned 600 total points
ID: 2490553
From the web:

Place a command button on the form..

Private Sub Command1_Click()
    Dim oOutLook As New Outlook.Application
    Dim oMail As Outlook.MailItem
   
    Set oMail = oOutLook.CreateItem(olMailItem)
    oMail.To = "Rauchs"
    With RichTextBox1
        .Text = ""
        .SelFontName = "Courier New"
        .SelFontSize = 24
        .SelColor = vbRed
        .SelText = "Your Message"
    End With
    oMail.Body = RichTextBox1.TextRTF
    oMail.Send
End Sub
0
 

Author Comment

by:rauchs
ID: 2490573
Wow!

What a great workaround!

thanks

steve
0
 

Author Comment

by:rauchs
ID: 2490620
Ruchi!

it doesn't work, It simply inserts the RTF text with all the slashes etc

eg

Tahoma;}{\f4\fswiss Courier;}{\f5\fswiss MS Sans Serif;}}
{\colortbl\red0\green0\blue0;\red255\green0\blue0;}
\deflang2057\horzdoc{\*\fchars }{\*\lchars }\pard\plain\f4\fs20\cf1

please advise on how to make outlook recognise that is should translate the text into rtf

thanks

steve
0
 
LVL 9

Expert Comment

by:Ruchi
ID: 2491559
I am not sure if this is working or not...


Private Sub Command1_Click()
    Dim oOutLook As New Outlook.Application
    Dim oMail As Outlook.MailItem
     
    Set oMail = oOutLook.CreateItem(olMailItem)

With oMail
 .To = "Rauchs"
 .Body = RichTextBox1.Text = ""
 .Body = RichTextBox1.SelFontName = "Courier New"
 .Body = RichTextBox1.SelFontSize = 24
 .Body = RichTextBox1.SelColor = vbRed
 .Body = RichTextBox1.SelText = "Your Message"
 .Send
End With

End Sub
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

607 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