Solved

Import Email From Outlook to Access in RTF

Posted on 2011-03-09
3
455 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Create high volume marketing opportunities using email signatures with these top 10 DOs and DON'Ts of email signature marketing.
Set OWA language and time zone in Exchange for individuals, all users or per database.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

746 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

17 Experts available now in Live!

Get 1:1 Help Now