Question : Outlook Task - Access Integration

I have a task list called "Daily Checklist" in outlook 2003. I use it to track the needed tasks for taking care of all the animals that we have in the pet store. (Sample attached) I have separate views created based on the category assigned to each task, for example Fish Dog Reptile etc. I then print out the view selected for not completed each day. I would like to be able to Import the tasks for each day to access to allow me to track how long each task is taking, who is doing which tasks and also allow for only printing out the tasks when we have the animal in stock.

Answer : Outlook Task - Access Integration

Soemthing like this should do it.  I don't do much work in Access and do not have Access 200 available any longer.  You may have to adjust the Access portion of this to get it to work.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
Sub ImportTasks()
    Const olFolderTasks = 13
    Dim olkApp As Object, _
        olkFolder As Object, _
        olkTask As Object, _
        adoTbl As Object
    Set adoTbl = New ADODB.Recordset
    Set adoTbl.ActiveConnection = CurrentProject.Connection
    adoTbl.Open "tblDataMeasures", , adOpenDynamic, adLockOptimistic
    Set olkApp = CreateObject("Outlook.Application")
    olkApp.GetNamespace("MAPI").Logon "Outlook"
    Set olkFolder = olkApp.Session.GetDefaultFolder(olFolderTasks)
    For Each olkTask In olkFolder.Items
        adoTbl.AddNew
        'Insert the appropriate Access field names below'
        adoTbl.Fields("") = olkTask.Body
        adoTbl.Fields("") = olkTask.Categories
        adoTbl.Fields("") = olkTask.DueDate
        adoTbl.Fields("") = olkTask.StartDate
        adoTbl.Fields("") = olkTask.Status
        adoTbl.Update
    Next
    Set olkTask = Nothing
    Set olkFolder = Nothing
    Set olkApp = Nothing
    Set adoTbl = Nothing
End Sub
Open in New Window Select All
Random Solutions  
 
programming4us programming4us