Retrieve Outlook contents through VBA (Wizard Blocked)

memaxt

Registered User.
Local time
Yesterday, 23:12
Joined
Mar 12, 2013
Messages
62
Hi everyone,

Basically i'm trying to link Access to Outlook to retrieve emails , When using the wizard to link outlook folder to Access it fails, i've been informed that this is due to the version of Access they have installed which is a ThinApplication.

So i was wondering would it be possible to access / link my outlook emails to access via VBA Coding?

All i need is the raw contents of the email and subject.

Many thanks
Max
 
This code reads the message for all mail in your Inbox:

Code:
 Dim olApp As New Outlook.Application
 Dim olIn As Outlook.Folder
 Dim olMail As MailItem
  
 Set olApp = Outlook.Application
 Set MAPISpace = olApp.GetNamespace("MAPI")
 Set olIn = MAPISpace.GetDefaultFolder(olFolderInbox)
  
 For Each olMail In olIn.Items
         strMessage = olMail.HTMLBody
 Next olMail
 

Users who are viewing this thread

Back
Top Bottom