Results 1 to 1 of 1
  1. #1
    Join Date
    Jan 2012

    Unanswered: Creating Outlook Task from Access 2007 (Code Included)

    I have a database for tracking action items. I have been asked to add a feature that will create an Outlook task after entering an Action Item. The plan is to have a button that you would push that would bring up the task with most of the data filled in. You could edit the task, then send it out.

    I have looked as similar previous posts, but everytime I try to code it, I get and error. Any suggestions on how to get this accomplished?

    Using the code below, I get "Compile Error: User-defined type not defined" on the line: Dim OutlookApp As Outlook.Application

    ___________ Code Below ________

    Private Sub Command63_Click()

    Dim OutlookApp As Outlook.Application
    Dim OutlookTask As Outlook.TaskItem
    Set OutlookApp = CreateObject("Outlook.Application")
    Set OutlookTask = OutlookApp.CreateItem(olTaskItem)

    With OutlookTask
    .Subject = "You have been assigned a task"
    .Body = "need to reference Action Item Database Here"
    .ReminderSet = True
    .ReminderTime = DateAdd("n", 2, Date)
    .DueDate = DateAdd("n", 5, Date)
    .Categories = "Need to identify category"
    .ContactNames = "If possible leave open so user can fill in who is assigned, or pull from database"


    End With

    Set OutlookApp = Nothing
    Set OutlookTask = Nothing

    End Sub


    Last edited by Trunner32; 01-24-12 at 04:40.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts