maxpouliot
04-03-2006, 08:02 PM
hello
the following code works :
<SCRIPT LANGUAGE="VBScript">
sub ajouterOutlook()
On error resume next
Const olAppointmentItem = 1
Set objOutlook = CreateObject("Outlook.Application")
Set objAppointment = objOutlook.CreateItem(olAppointmentItem)
If err.number = 0 Then
objAppointment.Start = #12/25/2005 17:00 PM#
'Utilisez soit objAppointment.Duration OU objAppointment.End, mais pas les deux
objAppointment.Duration = 5
'objAppointment.End = #12/25/2005 18:00 PM#
objAppointment.Subject = "test"
objAppointment.Body = "test"
objAppointment.Location = "#Salle"
objAppointment.ReminderMinutesBeforeStart = 10
objAppointment.ReminderSet = True
objAppointment.display
else
msg = "Veuillez démarrer Outlook avant d'appuyer sur le bouton."
MsgBox msg
end if
end sub
</script>
But, i would like to add arguments to the sub
example,
sub ajouterOutlook(startDate)
objAppointment.Start = #" & startDate & "17:00 PM#
Anyone knows how come this doesnt work?
the following code works :
<SCRIPT LANGUAGE="VBScript">
sub ajouterOutlook()
On error resume next
Const olAppointmentItem = 1
Set objOutlook = CreateObject("Outlook.Application")
Set objAppointment = objOutlook.CreateItem(olAppointmentItem)
If err.number = 0 Then
objAppointment.Start = #12/25/2005 17:00 PM#
'Utilisez soit objAppointment.Duration OU objAppointment.End, mais pas les deux
objAppointment.Duration = 5
'objAppointment.End = #12/25/2005 18:00 PM#
objAppointment.Subject = "test"
objAppointment.Body = "test"
objAppointment.Location = "#Salle"
objAppointment.ReminderMinutesBeforeStart = 10
objAppointment.ReminderSet = True
objAppointment.display
else
msg = "Veuillez démarrer Outlook avant d'appuyer sur le bouton."
MsgBox msg
end if
end sub
</script>
But, i would like to add arguments to the sub
example,
sub ajouterOutlook(startDate)
objAppointment.Start = #" & startDate & "17:00 PM#
Anyone knows how come this doesnt work?