Solved

Outlook tasks

Posted on 1998-09-06
5
264 Views
Last Modified: 2010-04-30
I am trying to access my tasks in Outlook 97 from vb 5.0, and put them into a table in MS Access 8.0. I would like to place each field in my tasks folder into a corrsponding field in the Access table. What is the code I need to do this?
0
Comment
Question by:damonc090698
  • 3
  • 2
5 Comments
 

Author Comment

by:damonc090698
ID: 1433326
Edited text of question
0
 
LVL 2

Expert Comment

by:Veroland
ID: 1433327
do you want the code for outlook or the code for Access, or both ?
0
 

Author Comment

by:damonc090698
ID: 1433328
I need the vb 5.0 code to go into Outlook read the tasks and put them into Access. I want the code in VB 5.0!
0
 
LVL 2

Accepted Solution

by:
Veroland earned 50 total points
ID: 1433329
For this example I have referenced DAO 3.5 and the msoutl85.olb file. There is a help file available (confusing though) called VBAOUTL.HLP wich is on the msoffice CD. Notify me if you want more info.

    Dim oApplic As Object
    Dim oItem As Object
    Dim olNameSpace As Object
    Dim DB As Database
    Dim SQL As String
    Dim I As Integer
       
    'connect to access database
    Set DB = OpenDatabase(App.Path & "\MyDB.mdb")
   
    'connect to the Outlook tasks
    Set oApplic = CreateObject("Outlook.Application")
    Set olNameSpace = oApplic.GetNamespace("MAPI")
    Set oItem = olNameSpace.GetDefaultFolder(olFolderTasks)
   
    'get the outlook tasks and insert access database
    For I = 1 To oItem.Items.Count
        SQL = "Insert into AccessTasks (TaskName) select '" & oItem.Items(I) & "'"
        DB.Execute SQL
    Next I
0
 

Author Comment

by:damonc090698
ID: 1433330
Thanks! It worked great!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question