A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

change font format in mail body using vba



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old January 31st 12, 10:35 AM
c_nixon c_nixon is offline
Junior Member
 
First recorded activity at Outlookbanter: Jan 2012
Location: Newport, South Wales, UK
Posts: 2
Question change font format in mail body using vba

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
Ads
  #2  
Old May 31st 12, 10:04 PM
NDuarte NDuarte is offline
Junior Member
 
First recorded activity at Outlookbanter: May 2012
Posts: 6
Default

Good afternoon!

To change the font you would need to use the following:
Code:
.HTMLBody = "bFONT size='5'UNCLASSIFIED/FONT/b"
instead of using .Body = "UNCLASSIFIED".

.Body opens up a plain text e-mail. When you use .HTMLBody you can incorporate HTML tags such as b for Bold and FONT to determine the size.

Hope this help!

Last edited by NDuarte : May 31st 12 at 10:32 PM. Reason: Add Code Tags
 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Change font in the body of a contact card? Jilli Outlook - Using Contacts 1 March 30th 10 10:24 PM
write and format a piece of text in the body using vba Screaming Eagles 101 Outlook and VBA 4 November 14th 09 03:26 AM
Changing the font body of an outlook task in vba Gary F Outlook and VBA 2 June 7th 06 09:20 PM
vba to change font of notes Charlie Outlook and VBA 3 March 9th 06 07:51 AM
How do I change the font of a mtg body in calendar details print? Mike Blasius Outlook - Calandaring 0 February 15th 06 03:53 PM


All times are GMT +1. The time now is 04:36 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.