Link to home
Start Free TrialLog in
Avatar of MikeMcEvoy
MikeMcEvoyFlag for United States of America

asked on

Import Email From Outlook to Access in RTF

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

ASKER CERTIFIED SOLUTION
Avatar of Jeffrey Coachman
Jeffrey Coachman
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of MikeMcEvoy

ASKER

Works perfect. Thanks!