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)
.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"
Set OutlookApp = Nothing
Set OutlookTask = Nothing