Olá Ricardo,
Vieira me mandou este código do Jpaulo, mas não sei como aproveitá-lo
Pode me ajudar ??
Obrigado
Public Function Outlook_Contacts_2_Access()
On Error GoTo No_Bugs
Dim CnnA As ADODB.Connection
Dim goRs As ADODB.Recordset
Dim oApp As Outlook.Application
Dim oNS As Outlook.NameSpace
Dim oInbox As Outlook.MAPIFolder
Dim oEmail As Outlook.MailItem
Dim i As Integer
Set oApp = New Outlook.Application
Set oNS = oApp.GetNamespace("MAPI")
Set oInbox = oNS.GetDefaultFolder(olFolderInbox)
Dim sSQL As String
Set CnnA = New ADODB.Connection
Set goRs = New ADODB.Recordset
'YOU WILL NEED TO CREATE YOUR TABLE IN ACCESS TO MATCH AND CALL IT INBOX
sSQL = "SELECT * FROM [Inbox] WHERE 1=2;"
goRs.Open sSQL, CnnA, adOpenKeyset, adLockOptimistic, adCmdText
frmMain.prbProgress.Max = oInbox.Items.Count
i = 1
Do While i <= oInbox.Items.Count
Set oEmail = oInbox.Items(i)
DoEvents
goRs.AddNew
goRs!To = oEmail.To
goRs!CC = oEmail.CC
goRs!BCC = oEmail.BCC
goRs!Subject = oEmail.Subject
goRs!Body = oEmail.Body
goRs!HTMLBody = oEmail.HTMLBody
goRs!Importance = oEmail.Importance
goRs!Received = oEmail.ReceivedTime
goRs!MessageClass = oEmail.MessageClass 'EMAIL, MEETING RESPONSE, MEETING REQUEST, ETC.
goRs!ReceivedByName = oEmail.ReceivedByName
'CONTINUE ON WITH OTHER FIELDS YOU WANT
'...
goRs.Update
Set oEmail = Nothing
frmMain.prbProgress.Value = i
i = i + 1
Loop
Set oEmail = Nothing
Set oInbox = Nothing
Set oNS = Nothing
goRs.Close
Set CnnA = Nothing
Set goRs = Nothing
Exit Function
No_Bugs:
MsgBox Err.Number & "-" & Err.Description, vbCritical, "Outlook Email Export"
Resume Next
End Function