Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2008
    Posts
    9

    Add task from Access to Outlook

    I created a code that will add an appointment form access to outlook successfully but I have dificulty in creating a code to add a task from access to outlook. I get an error 438 "Object doesn't support this property or method". The code I use is the following. PLEASE HELP ME.

    code
    ---------------
    Private Sub cmdAddTask_Click()
    On Error GoTo Add_Err

    'Save record first to be sure required fields are filled.
    DoCmd.RunCommand acCmdSaveRecord

    'Exit the procedure if task has been added to Outlook.
    If Me!AddedToOutlook = True Then
    MsgBox "This task is already added to Microsoft Outlook"
    Exit Sub
    'Add a new task.
    Else
    Dim objOutlook As Outlook.Application
    Dim objTask As Outlook.TaskItem

    Set objOutlook = CreateObject("Outlook.Application")


    Set objTask = objOutlook.CreateItem(olTaskItem)

    With objTask
    .Start = Me!TaskDate
    .Subject = Me!TaskSubject

    If Not IsNull(Me!TaskNotes) Then .Body = Me!TaskNotes
    If Me!TaskReminder Then
    .ReminderMinutesBeforeStart = Me!ReminderMinutes
    .ReminderSet = True
    End If

    .Save
    .Close (olSave)
    End With
    'Release the TaskItem object variable.
    Set objTask = Nothing
    End If

    'Release the Outlook object variable.
    Set objOutlook = Nothing

    'Set the AddedToOutlook flag, save the record, display a message.
    Me!AddedToOutlook = True
    DoCmd.RunCommand acCmdSaveRecord
    MsgBox "Task Added!"

    Exit Sub

    Add_Err:
    MsgBox "Error " & Err.Number & vbCrLf & Err.Description
    Exit Sub

    End Sub
    ----------------------
    code end

  2. #2
    c_smithwick is offline Underpaid Programmer
    Windows 7 Access 2003
    Join Date
    Jan 2010
    Location
    Lakeside, CA
    Posts
    49
    Try the following. It might steer you in the right direction:

    http://www.xtremevbtalk.com/archive/.../t-185614.html

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Outlook Form to Access problem
    By bearsgone in forum Import/Export Data
    Replies: 1
    Last Post: 02-04-2010, 11:14 AM
  2. Outlook to Access
    By Aubreylc in forum Import/Export Data
    Replies: 1
    Last Post: 01-25-2010, 09:37 AM
  3. MS-Access into Outlook - possible?
    By techexpressinc in forum Access
    Replies: 0
    Last Post: 01-09-2009, 01:44 PM
  4. Reading outlook tasks from Access
    By Bill_dom in forum Import/Export Data
    Replies: 0
    Last Post: 08-07-2008, 06:02 PM
  5. Export Access reports/query results to Outlook Calendar/Task
    By kfinpgh in forum Import/Export Data
    Replies: 0
    Last Post: 02-22-2007, 01:09 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums