Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming VBA / July 2004

Tip: Looking for answers? Try searching our database.

HTML Formating simple text mail received from other/Linux/Unix mail clients

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David - 28 Jul 2004 01:51 GMT
Hello,
I am using outlook2003 and i am interacting with non outlook users that most
of them used to plain text. After short discussion thread the email body
become messy with lots of >>>> etc.
I want to be able to open such mail and convert it to something more
resonable to read by my eyes.

My approach was to convert the message to HTMLBody format, process the body
content and add HTML tags to it (fonts, color, indentetion etc) then save
the item.

It looks like these HTML tags are added as a simple text and does not affect
how the message is displayed.

Any pointer how to solve this or take another approach?
I am trying to stay with HTML and avoide RTF as some of the receipients
could still view html format.
Thanks in advance
David
Sue Mosher [MVP-Outlook] - 28 Jul 2004 02:16 GMT
Did you mean to show a code snippet to illustrate what you've been working
on?

Signature

Sue Mosher, Outlook MVP
Author of
    Microsoft Outlook Programming - Jumpstart for
    Administrators, Power Users, and Developers
    http://www.outlookcode.com/jumpstart.aspx

> Hello,
> I am using outlook2003 and i am interacting with non outlook users that most
[quoted text clipped - 15 lines]
> Thanks in advance
> David
David - 28 Jul 2004 03:06 GMT
this is work in progress and represents various trials to understand what is
going on and NOT a resonable code to work with. It just shows you what i am
trying to do. so with this here is the current code:

   Set myOlApp = CreateObject("Outlook.Application")
   Set MyItem = myOlApp.ActiveInspector.CurrentItem
   MyItem.BodyFormat = olFormatHTML
   TempBody = Replace(MyItem.Body, ">", "===>", 1, -1, vbTextCompare)
   MyItem.Body = TempBody
   TempBody = Replace(MyItem.Body, "[", "[[", 1, -1, vbTextCompare)
   MyItem.Body = TempBody
   TempBody = Replace(MyItem.Body, "html", "--  XXXXXX - ", 1, -1,
vbTextCompare)
   MyItem.Body = "<html><body><font face=""Terminal""  color=""FF0000"">" &
TempBody ' & "</font><body></html>"

david

> Did you mean to show a code snippet to illustrate what you've been working
> on?
[quoted text clipped - 21 lines]
> > Thanks in advance
> > David
Tomski - 28 Jul 2004 09:31 GMT
> this is work in progress and represents various trials to understand
> what is going on and NOT a resonable code to work with. It just shows
[quoted text clipped - 13 lines]
>
> david

How about:
MyItem.HtmlBody = "<html><body><font face=""Terminal""  color=""FF0000"">" &
TempBody ' & "</font><body></html>"

Signature

Greets
Tomski

David - 30 Jul 2004 07:07 GMT
yes. thanks. this is correct.
David
> > this is work in progress and represents various trials to understand
> > what is going on and NOT a resonable code to work with. It just shows
[quoted text clipped - 17 lines]
> MyItem.HtmlBody = "<html><body><font face=""Terminal""  color=""FF0000"">" &
> TempBody ' & "</font><body></html>"
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.