View Single Post
  #2  
Old May 25th 06, 08:48 AM posted to microsoft.public.outlook.program_vba
Michael Bauer
external usenet poster
 
Posts: 435
Default Setting the ReminderTime gives strange results

Am Wed, 24 May 2006 05:51:02 -0700 schrieb Tim_Pope:

What time do you expect and what is it instead?

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.vbOffice.net --


I am using the following code in an Access database to create an Outlook

Task
Item automatically. All is fine, except that the Reminder Date is always
incorect. Any suggestions as to why, or more impoortantly, how to fix the
problem, would be appreciated.

Public Sub SetReminder()

Dim OutlookApp As Outlook.Application
Dim OutlookTask As Outlook.TaskItem
Dim RemDate As Date

Set OutlookApp = CreateObject("Outlook.Application")
Set OutlookTask = OutlookApp.CreateItem(olTaskItem)
RemDate = Forms!frm_Action_New.RemindMe

With OutlookTask
.Subject = "Auto-Reminder for Item Reference - " & Me.Item_Ref
.Body = "Action:" & vbCrLf & Me.Action_Note & vbCrLf & vbCrLf _
& "Business Owner:" & vbCrLf & Me.Action_Bus_Owner & vbCrLf & vbCrLf _
& "Target date for completion:" & vbCrLf & Me.Target_Date
.StartDate = Date
.ReminderSet = True
.ReminderTime = RemDate & " " & CDate(#9:00:00 AM#)
.DueDate = Me.Target_Date
.Categories = "AutoReminder"
.ReminderPlaySound = True
.ReminderSoundFile = "C:\Windows\Media\Ding.wav"
.Save
End With

End Sub

Ads