![]() |
|
#1
|
|||
|
|||
![]()
Hi,
I have an Access (2007) database which creates Outlook (also 2007) email messages using VBA, using code such as the following (skipping some code for brevity): Code:
Dim oOutlook As Outlook.Application Dim oMsg As Outlook.MailItem Dim oRecipient As Outlook.Recipient Dim oAttachment As Outlook.Attachment Set oOutlook = New Outlook.Application Set oMsg = oOutlook.CreateItem(olMailItem) With oMsg .Display Set oRecipient = .Recipients.Add(to_item) .subject = subject .Body = msgBody .Importance = olImportanceNormal End With In the above code, msgBody is a String variable storing the value of the RichTextBox control. Now my email message looks like the following, including the html codes. <div>Here are the latest list in PDF format. You will need the Adobe Reader to open this file. Download it for free at <a href="http://get.adobe.com/reader/">http://get.adobe.com/reader/</a></div> <div> </div> <div>Verify names are correct, and let me know if any problems. </div> The outlook message is already set to display as an HTML message. I tried changing this to a RichText message, but to no avail. Does anybody know how to properly get the rich text into the outlook message body using VBA, so it will show up properly? Thanks... |
#2
|
|||
|
|||
![]()
Follow-up:
I notice there is a .HTMLBody property to the outlook message object. When I use this, the message now contains the text only, with <div>, etc tags not visible. Problem with this is that the message no longer looks correct. My default font is replaced with Times New Roman, and my signature style, including font, size and colors is negated, also appearing in Times New Roman. A possible solution is to strip all the HTML codes from the text before supplying it to the message's .Body property. Any ideas? Thanks... |
![]() |
Tags |
access, outlook 2007, vba |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Automating document updates with new text | wordfoolish2 | Word | 0 | 01-04-2011 01:01 PM |
Automating an address from an Abbreviation | Panzer | Word | 0 | 04-12-2010 06:11 AM |
Access 2007 Upgrade After Initial Install - Access 2003 Won't Remove | wcb | Office | 1 | 01-25-2010 04:08 AM |
![]() |
jshollis | Outlook | 1 | 05-06-2009 03:22 PM |
Automating Cel Population of .jpg | skoz55 | Excel | 0 | 01-21-2009 03:43 AM |