Retrieve HTML body from attachment 
Author Message
 Retrieve HTML body from attachment

I have an Outlook message with an attachment.  The attachment is mail that
is HTML format.  I want to read the raw HTML.

If I save the attachment contents via the Attachment SaveAsFile method, the
result is a (somewhat) binary format.  How do I decode it?

Of course, what I'd really like is something like MailItem's HTMLBody
property but on Attachment.  Baring that, is there a way to (temporarily)
create a new MailItem whose HTMLBody is initialized from an Attachment (so I
could then read the attachment's HTML body via MailItem.HTMLBody)?

Thanks.

Dave Lennert



Sun, 10 Jul 2005 07:39:57 GMT  
 Retrieve HTML body from attachment
Save the attachment as an msg file, then import it into a new message in
Outlook using Application.CreateItemFromTemplate().

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy  - Outlook, CDO
and MAPI Developer Tool


Quote:
> I have an Outlook message with an attachment.  The attachment is mail that
> is HTML format.  I want to read the raw HTML.

> If I save the attachment contents via the Attachment SaveAsFile method,
the
> result is a (somewhat) binary format.  How do I decode it?

> Of course, what I'd really like is something like MailItem's HTMLBody
> property but on Attachment.  Baring that, is there a way to (temporarily)
> create a new MailItem whose HTMLBody is initialized from an Attachment (so
I
> could then read the attachment's HTML body via MailItem.HTMLBody)?

> Thanks.

> Dave Lennert



Mon, 11 Jul 2005 02:11:18 GMT  
 Retrieve HTML body from attachment
Works great!  Thanks!


Quote:
> Save the attachment as an msg file, then import it into a new message in
> Outlook using Application.CreateItemFromTemplate().

> Dmitry Streblechenko (MVP)
> http://www.dimastr.com/
> OutlookSpy  - Outlook, CDO
> and MAPI Developer Tool



> > I have an Outlook message with an attachment.  The attachment is mail
that
> > is HTML format.  I want to read the raw HTML.

> > If I save the attachment contents via the Attachment SaveAsFile method,
> the
> > result is a (somewhat) binary format.  How do I decode it?

> > Of course, what I'd really like is something like MailItem's HTMLBody
> > property but on Attachment.  Baring that, is there a way to
(temporarily)
> > create a new MailItem whose HTMLBody is initialized from an Attachment
(so
> I
> > could then read the attachment's HTML body via MailItem.HTMLBody)?

> > Thanks.

> > Dave Lennert



Wed, 13 Jul 2005 05:57:58 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Retrieving attachments and body from .msg files using a standalone application

2. Html attachment visible in mailitem body

3. HTML attachment displayed in message body in MS Outlook

4. Q: Attachment: How to insert filename of attachment in message body

5. vbCrLf after attachment - (not '.Body')

6. Body Layout with an Attachment

7. Attachments and the mail Body

8. Inserting attachments in body for RTF format.

9. Attachment in body of message

10. Saving Body Text From Attachments

11. Saving Item.body and item.attachment

12. Retrieving message body text of currently selected message

 

 
Powered by phpBB® Forum Software