It's been a few years since I played around in VBA and I'm feeling rusty.
I have a little database for tracking project expiration/due dates. I am wanting to use the data I have entered in a form to make a task in outlook when I click a button on the form.
I've been digging through the net and found the following:
Function AddOutLookTask()
Dim appOutLook As Outlook.Application
Dim taskOutLook As Outlook.TaskItem
Set appOutLook = CreateObject("Outlook.Application")
Set taskOutLook = appOutLook.CreateItem(olTaskItem)
With taskOutLook
.Subject = "Expiration Approaching"
.Body = "text of body here"
.ReminderSet = True
.ReminderTime = DateAdd("n", 2, Now)
.DueDate = DateAdd("n", 5, Now)
.ReminderPlaySound = True
'add the path to a .wav file on your computer.
.ReminderSoundFile = "C:\Win95\media\ding.wav"
.Save
End With
End Function
But when I try to specify the form and fields where I want to pull the data from, I get errors or it doesn't pull anything at all.
I'd like to pull Due Date, Reminder Date, Subject, and Body from the form.
Suggestions?