Solved

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

Posted on 2008-10-08
3
1,483 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
ID: 22675935
mymailitem.bodyformat = olformathtml

does it nicely

Chris
0
 

Author Closing Comment

by:doshoss
ID: 31504538
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
ID: 22681053
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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you’re making plans to join the modern business race, you should analyze various details that may affect your results. Nowadays, millions of businesses are trying to grow into established and appreciated professional enterprises.
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 …
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

828 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