...

View Full Version : add outlook Appointment



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?

Brandoe85
04-03-2006, 08:11 PM
What error are you getting?

maxpouliot
04-03-2006, 08:14 PM
What error are you getting?

outlook object doesnt appear anymore

Brandoe85
04-03-2006, 08:33 PM
Try just adding the date variable:


<html>
<head>
<SCRIPT LANGUAGE="VBScript">
sub ajouterOutlook(startDate)
On error resume next
Const olAppointmentItem = 1
Set objOutlook = CreateObject("Outlook.Application")
Set objAppointment = objOutlook.CreateItem(olAppointmentItem)
If err.number = 0 Then
objAppointment.Start = startDate
'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>
</head>
<body onload="ajouterOutlook('4/10/2006')">
</body>
</html>


Good luck;



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum