change font format in mail body using vba

C

c_nixon

i have the following code that opens a new mail and adds "UNCLASSIFIED
to the start of the subject and body. What i need is some code that wil
format the the body instance of the word to be bold and larger than th
rest of the text that will appear in the body (organisational rules).

Sub Unclass_Msg()
Dim msg As Outlook.MailItem
Set msg = Application.CreateItem(olMailItem)
With msg
.Subject = "UNCLASSIFIED - "
.Body = "UNCLASSIFIED"
.Display
End With
End Su
 
M

Michael Bednarek

i have the following code that opens a new mail and adds "UNCLASSIFIED"
to the start of the subject and body. What i need is some code that will
format the the body instance of the word to be bold and larger than the
rest of the text that will appear in the body (organisational rules).

Sub Unclass_Msg()
Dim msg As Outlook.MailItem
Set msg = Application.CreateItem(olMailItem)
With msg
Subject = "UNCLASSIFIED - "
Body = "UNCLASSIFIED"
Display
End With
End Sub

The code as presented above cannot possibly work; it's missing the
qualifying dots.

To the core matter: if you want to manipulate an HTML body, you have to
use the HTMLBody property, e.g.:

Sub Unclass_Msg()
Dim msg As Outlook.MailItem
Set msg = Application.CreateItem(olMailItem)
With msg
.Subject = "UNCLASSIFIED - "
.HTMLBody = "<b>UNCLASSIFIED</b>"
.Display
End With
End Sub
 

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