Adding Task to Outlook

G

gumby

Option Compare Database
Option Explicit

Function AddOutLookTask()
Dim OutlookApp As Outlook.Application
Dim OutlookTask As Outlook.TaskItem
Set OutlookApp = CreateObject("Outlook.Application")
Set OutlookTask = OutlookApp.CreateItem(olTaskItem)
With OutlookTask
.Subject = "Date Case Began: " & [Forms]![frmERLR_Main]!
[DateCaseBegin] & " Action Type: " & [Forms]![frmERLR_Main]!
[ActionType] & " - " & [Forms]![frmERLR_Main]![ERLRAgencyName] & " -
Management POC: " & [Forms]![frmERLR_Main]![ManagementPOC]
.Body = "Issue: " & [Forms]![frmERLR_Main]![ERLRIssue] & " -
Recommendation: " & [Forms]![frmERLR_Main]![ERLRRec]
.ReminderSet = True
'Remind
.ReminderTime = [Forms]![frmReminder]![StartTime]
'Start Date
.StartDate = [Forms]![frmReminder]![StartDateE]
'Due .
.DueDate = [Forms]![frmReminder]![StartDateE]
.ReminderPlaySound = True
'Modify path.
.ReminderSoundFile = "C:\WINNT\Media\Ding.wav"
.Save
End With
End Function


When I call the function to add a task to outlook for the same day as
today and set the reminder time, it puts Sat 12/30/1899 in the
reminder date but the time is correct.


When I call the function for a date in the future, it gets the
reminder date correct, but defualts the time to 08:00AM.


Any ideas?
 
K

Ken Slovak - [MVP - Outlook]

1899 means no valid date value was entered. I have no idea what those fields
you're referencing contain as data, but the standard is to set a date value
using date and time parts with no seconds in the time part and assign that
date value to ReminderTime.

Try it as a test with a hard coded value and see what happens:

.ReminderTime = Now
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top