Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Outlook tasks

Posted on 1998-09-06
5
Medium Priority
?
267 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…
Suggested Courses

721 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