S
sparkle
Hi,
Does anybody know how to convert date to ticks from a dateTimePicker?
What I'm using now isn't working.
I'm trying to use a dateTimePicker to set an appointment in Outlook
with a reminder. I need this reminder to remind the recipient 14 days
in advance.
I'm having problems with the ReminderMinutesBeforeStart. If I simply
multiply the minutes by the days, the reminder doesn't have the
checkbox checked or it is checked, but with 0 minutes. As if it can't
figure out that many minutes.
I've written some code to do this for me, but with the same results
(checkbox in the reminder set to 0 minutes).
Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnSave.Click
Dim oApp As Outlook.Application = New Outlook.Application
Dim lDays As Long
Dim lMinutes As Long
lMinutes = DaysToMinutes(lDays)
' Create a new AppointmentItem.
Dim oAppt As Outlook.AppointmentItem =
oApp.CreateItem(Outlook.OlItemType.olAppointmentItem)
oAppt.Subject = "Parking Permits Will expire in two weeks"
oAppt.Body = "Let Employees with Parking Permits know the
expiration date is two weeks away"
oAppt.Location = "Watsonville"
oAppt.Start = Convert.ToDateTime(dtpExpired.Value)
oAppt.End = Convert.ToDateTime(dtpExpired.Value)
oAppt.ReminderSet = True
oAppt.ReminderMinutesBeforeStart = lMinutes
' Save to Calendar.
oAppt.Save()
' Clean up.
oApp = Nothing
oAppt = Nothing
End Sub
Function DaysToMinutes(ByVal days As Long) As Long
Return days =20160
End Function
End Class
Does anybody know if the TimeStamp would work better for subtracting
days? If so, how do I convert the date to ticks?
Here is a TimeSpan string that could be used to show negative values:
"[-]14:00:00:00", but this is using ticks...
Thanks,
Does anybody know how to convert date to ticks from a dateTimePicker?
What I'm using now isn't working.
I'm trying to use a dateTimePicker to set an appointment in Outlook
with a reminder. I need this reminder to remind the recipient 14 days
in advance.
I'm having problems with the ReminderMinutesBeforeStart. If I simply
multiply the minutes by the days, the reminder doesn't have the
checkbox checked or it is checked, but with 0 minutes. As if it can't
figure out that many minutes.
I've written some code to do this for me, but with the same results
(checkbox in the reminder set to 0 minutes).
Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnSave.Click
Dim oApp As Outlook.Application = New Outlook.Application
Dim lDays As Long
Dim lMinutes As Long
lMinutes = DaysToMinutes(lDays)
' Create a new AppointmentItem.
Dim oAppt As Outlook.AppointmentItem =
oApp.CreateItem(Outlook.OlItemType.olAppointmentItem)
oAppt.Subject = "Parking Permits Will expire in two weeks"
oAppt.Body = "Let Employees with Parking Permits know the
expiration date is two weeks away"
oAppt.Location = "Watsonville"
oAppt.Start = Convert.ToDateTime(dtpExpired.Value)
oAppt.End = Convert.ToDateTime(dtpExpired.Value)
oAppt.ReminderSet = True
oAppt.ReminderMinutesBeforeStart = lMinutes
' Save to Calendar.
oAppt.Save()
' Clean up.
oApp = Nothing
oAppt = Nothing
End Sub
Function DaysToMinutes(ByVal days As Long) As Long
Return days =20160
End Function
End Class
Does anybody know if the TimeStamp would work better for subtracting
days? If so, how do I convert the date to ticks?
Here is a TimeSpan string that could be used to show negative values:
"[-]14:00:00:00", but this is using ticks...
Thanks,