?
Solved

Import Email From Outlook to Access in RTF

Posted on 2011-03-09
3
Medium Priority
?
466 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 2000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
With so many activities to perform, Exchange administrators are always busy in organizations. If everything, including Exchange Servers, Outlook clients, and Office 365 accounts work without any issues, they can sit and relax. But unfortunately, it…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses

755 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