Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Mar 2006
    Posts
    93
    Thanks
    3
    Thanked 0 Times in 0 Posts

    add outlook Appointment

    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?

  • #2
    teh Moderatorinator
    Join Date
    Sep 2004
    Location
    USA
    Posts
    2,472
    Thanks
    4
    Thanked 40 Times in 40 Posts
    What error are you getting?

  • #3
    New Coder
    Join Date
    Mar 2006
    Posts
    93
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Brandoe85
    What error are you getting?
    outlook object doesnt appear anymore

  • #4
    teh Moderatorinator
    Join Date
    Sep 2004
    Location
    USA
    Posts
    2,472
    Thanks
    4
    Thanked 40 Times in 40 Posts
    Try just adding the date variable:
    PHP Code:
    <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;


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •