PC Review


Reply
Thread Tools Rate Thread

Building Outlook email body in VB

 
 
mscertified
Guest
Posts: n/a
 
      23rd Oct 2008
In an Access database I build an email body for Outlook. It is just a
concatenation of text strings and variables. Does anyone know how I could
vary the font and or boldness of selected pieces of the text? Here is
skeleton code:

Set olObject = CreateObject("Outlook.Application")
Set myNameSpace = olObject.GetNamespace("MAPI")
Set myFolder = myNameSpace.GetDefaultFolder(olFolderInbox)
Set myItem = olObject.CreateItem(olMailItem)
<creates variable Msg>
myItem.Body = Msg
myItem.Display
AppActivate myItem.Subject

Thanks.
 
Reply With Quote
 
 
 
 
Michael Bauer [MVP - Outlook]
Guest
Posts: n/a
 
      23rd Oct 2008


You need to write the text to the HTMLBody property. And you need to use the
HTML syntax, of course.

<p>this a paragraph</p>
<p>this a <b>bold</b> paragraph</p>
<p style='font-size:48pt;'>huge by using css</p>

--
Best regards
Michael Bauer - MVP Outlook

: VBOffice Reporter for Data Analysis & Reporting
: Outlook Categories? Category Manager Is Your Tool
: <http://www.vboffice.net/product.html?pub=6&lang=en>


Am Thu, 23 Oct 2008 13:19:00 -0700 schrieb mscertified:

> In an Access database I build an email body for Outlook. It is just a
> concatenation of text strings and variables. Does anyone know how I could
> vary the font and or boldness of selected pieces of the text? Here is
> skeleton code:
>
> Set olObject = CreateObject("Outlook.Application")
> Set myNameSpace = olObject.GetNamespace("MAPI")
> Set myFolder = myNameSpace.GetDefaultFolder(olFolderInbox)
> Set myItem = olObject.CreateItem(olMailItem)
> <creates variable Msg>
> myItem.Body = Msg
> myItem.Display
> AppActivate myItem.Subject
>
> Thanks.

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
New Email Message in Outlook 2007 starts in Body of email not in To:field gba1818@gmail.com Microsoft Outlook 3 28th Mar 2008 01:23 AM
outlook email body is blank =?Utf-8?B?dmtz?= Microsoft Outlook Discussion 2 29th Oct 2007 02:42 PM
Late Binding to Outlook from Excel: Outlook modifies email body Lenny Wintfeld Microsoft Excel Programming 1 12th Dec 2004 10:49 PM
How can I distinguish the email body is plain text or html body? epjames Microsoft Outlook VBA Programming 10 2nd Sep 2004 01:03 PM
Outlook Express 6-receiving email with an .html attachment duplicating same text from body of email =?Utf-8?B?TGlseQ==?= Windows XP Internet Explorer 1 22nd Jan 2004 05:29 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:50 AM.