Sync Outlook 2016 inbox\Outbox with my database (1 Viewer)

gstylianou

Registered User.
Local time
Today, 15:12
Joined
Dec 16, 2013
Messages
357
Hi all,

Is that a way to sync the outlook tables (inbox and outbox) into an access database automatically? If so, can anyone to explain what I must do?
Thanks
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 13:12
Joined
Jul 9, 2003
Messages
16,269
Is this Helpful?

Import or link to contacts from an Outlook address book
Access for Office 365 Access 2019 Access 2016 Access 2013 Access 2010 Access 2007

Extract:-
Access and Outlook are both excellent programs for managing your personal and business contacts. As a result, you might want to import or link to contact data from Outlook into Access.

https://support.office.com/en-gb/ar...3c5d0d&ui=en-US&rs=en-GB&ad=GB#__toc288734415
 

Gasman

Enthusiastic Amateur
Local time
Today, 13:12
Joined
Sep 21, 2011
Messages
14,217
Here is something I used just to test copying selected emails to a DB
You should be able to select the correct Outlook folder and work out what needs to be added in some way.?

HTH
Code:
Public Sub EmailsToAccess()
    'Dim Session As Outlook.NameSpace
    Dim currentExplorer As Explorer
    Dim oSelection As Outlook.Selection
    Dim strSubject1 As String, strSubject2 As String
    Dim objAccess As Object, rsEmail As Object
    Dim dbs As Object
    Dim i As Long
    Dim obj As Object
    Dim strDB As String
 
 ' Initialize string to database path.
 Const strDBPath = "C:\Users\Paul\Documents\"

    Set currentExplorer = Application.ActiveExplorer
    Set oSelection = currentExplorer.Selection
    
    Set objAccess = CreateObject("Access.Application")
    objAccess.opencurrentdatabase (strDBPath & "OutlookEmails.accdb")
    Set dbs = CurrentDb
    Set rsEmail = dbs.openrecordset("SELECT * from tblEmail WHERE ID=0", 2) 'dbopendynaset
    
    For Each obj In Selection
 
     With obj
        rsEmail.addnew
        rsEmail!EmailSubject = .Subject
        rsEmail!EmailPerson = .Sender
        rsEmail!EmailDate = .datesent
        rsEmail!EmailTime = .timesent
        rsEmail.Update
     End With

    Next
'    strSubject1 = oSelection.Item(1).Subject
'    For i = 2 To oSelection.Count
'        strSubject2 = oSelection.Item(i).Subject
'        'Debug.Print "1 " & strSubject1
'        'Debug.Print "2 " & strSubject2
'        If strSubject1 = strSubject2 Then
'            oSelection.Item(i).Delete
'        Else
'            strSubject1 = oSelection.Item(i).Subject
'        End If
'    Next i
    
    Close rsEmail
    Set rsEmail = Nothing
    Set dbs = Nothing
    Set objAccess = Nothing
    
    'Set Session = Nothing
    Set currentExplorer = Nothing
    Set obj = Nothing
    Set oSelection = Nothing

End Sub
 

gstylianou

Registered User.
Local time
Today, 15:12
Joined
Dec 16, 2013
Messages
357
Good morning and gave a nice week,

I'm back again in order to make clear on what exactly need to do. I just wanted to see and control my emails form outlook into an access form as well as to set appointment form access form and to have automatic sync into an Outlook app. The Second part its Ok because already its done.

Thanks all
 

Users who are viewing this thread

Top Bottom