Solved

Converting a rich text email body to an html format in Outlook VBA

Posted on 2008-10-08
3
1,472 Views
Last Modified: 2013-11-30
I have written a VBA routine in Outlook VBA that generates the rich text format body of an email, that is ultimately successfully sent as a mail item. Contained in the body of that email is a link to another html form that I have developed.

That html form I am referencing via link within my email body has a number of parameters built int it. At the end of the day, the URL is quite long and an eyesore to the user receiving the email.

My ultimate objective would be change the display name of the link in the body of my rich text email to something other than just the URL... but to the best of my knowledge, this is not possible in rich text.

Is there a way to programmatically change the email body from rich text to html, then send the email as "olformatHTML". Once I've gotten it into an html format, I can do some simple find and replace work to associate the display name with the link. I just don't want to have to build a routine to generate html.

Again, my canvas is Outlook VBA.

Kind regards,

Dan
0
Comment
Question by:doshoss
  • 2
3 Comments
 
LVL 59

Accepted Solution

by:
Chris Bottomley earned 125 total points
Comment Utility
mymailitem.bodyformat = olformathtml

does it nicely

Chris
0
 

Author Closing Comment

by:doshoss
Comment Utility
Chris,

Thanks... all my reading on the internet lead me to believe that this would NOT perform an actual conversion of format, but in fact it does. Now that I've got this into an html format, I will need to address the issue of putting a display name on my link. Aside from a brute force find and replace of the html body, is there a collection I can work with to edit the link in my email body?

Dan
0
 
LVL 59

Expert Comment

by:Chris Bottomley
Comment Utility
I'm not very up on HTML conversions but there are routines out there that do it, can't recall one off hand but if the text is converted to HTML and stuffed into the HTMLbody then a simple substitution should do it.

Chris
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Email signatures have numerous marketing benefits. Here are 8 top reasons to turn your email signature into a marketing channel.
Check out this infographic on what you need to make a good email signature that will work perfectly for your organization.
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 Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now