Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Outlook tasks

Posted on 1998-09-06
5
Medium Priority
?
269 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 200 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

Independent Software Vendors: 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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

876 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