Solved

Import Email From Outlook to Access in RTF

Posted on 2011-03-09
3
456 Views
Last Modified: 2012-06-21
When importing an email from outlook into an access table the formatting on the email is lost.

I have the memo filed in the table set to RTF however the outlook object "Mailobject.Body" only seems to pull in the clear text format.

Any suggestions?
Set OlApp = CreateObject("Outlook.Application")
    Set Inbox = OlApp.GetNamespace("Mapi").GetDefaultFolder(olFolderInbox)
     
    Set rstAddEmail = CurrentDb.OpenRecordset("tblInvestigationEmails")
    Set rstAddAttachment = CurrentDb.OpenRecordset("tblInvestigationAttachments")

        Set Mailobject = OlApp.ActiveExplorer.Selection(1)

        With rstAddEmail
            On Error Resume Next
            .AddNew
            !DateAdded = Now
            !EmailNumber = strEmailNumber
            !Subject = Mailobject.Subject
            !From = Mailobject.SenderName
            !To = Mailobject.To
            !Body = Mailobject.Body
            !DateSent = Mailobject.SentOn
            .Update
            'Mailobject.Read = True
        End With

Open in new window

0
Comment
Question by:MikeMcEvoy
  • 2
3 Comments
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 500 total points
ID: 35084993
try:
!Body = Mailobject.HTMLBody
0
 
LVL 2

Author Comment

by:MikeMcEvoy
ID: 35085037
Works perfect. Thanks!
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 35085104
;-)
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Following basic email etiquette rules will help you write a professional email and achieve a good, lasting impression with your contacts.
This article lists the top 5 free OST to PST Converter Tools. These tools save a lot of time for users when they want to convert OST to PST after their exchange server is no longer available or some other critical issue with exchange server or impor…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

911 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

22 Experts available now in Live!

Get 1:1 Help Now