objAppointment.Start w/ Field reference - InfoPath Dev
in

InfoPath Dev

objAppointment.Start w/ Field reference

Last post 11-04-2005 11:18 AM by franck. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 11-04-2005 08:16 AM

    objAppointment.Start w/ Field reference

    How do I reference a text or date picker field for objAppointment.Start part of the script?



    Const olAppointmentItem = 1

    Set objOutlook = CreateObject("Outlook.Application")

    Set objAppointment = objOutlook.CreateItem(olAppointmentItem)

    objAppointment.Start = #11/3/2005 11:00 AM#

    objAppointment.Duration = 60

    objAppointment.Subject = "Complete Applicant Review"

    objAppointment.Body = "Make sure all feedback is complete and create feedback summary."

    objAppointment.Location = ""

    objAppointment.ReminderMinutesBeforeStart = 15

    objAppointment.ReminderSet = True







    objAppointment.Save
  • 11-04-2005 08:51 AM In reply to

    Re: objAppointment.Start w/ Field reference

    Hi,

    Your need to point to the node associated with your Date Picker and convert the ISO8601 Date by scripting.

    In JScript for example, it would be:

    var date1 = XDocument.DOM.selectSingleNode( "//my:field1" ).text;
    var dt1 = ISO8601ToDate(date1);
    // dt1 can then be used as a regular date
    function ISO8601ToDate(dateString)
    {return new Date(dateString.split('-').reverse().join('/')) }

    Hope that it helps.

    Regards,

    Franck Dauché
  • 11-04-2005 09:56 AM In reply to

    Re: objAppointment.Start w/ Field reference

    Thanks, I got the code to work (below). Would you know the statement to use to add 1 week to whatever date it's referencing in the field?


    Dim objField

    Set objField = XDocument.DOM.selectSingleNode("//my:myFields/my:Date_Interview")

    Const olAppointmentItem = 1

    Set objOutlook = CreateObject("Outlook.Application")

    Set objAppointment = objOutlook.CreateItem(olAppointmentItem)

    dim theDate

    theDate = objField.text & " 9:00 AM"

    objAppointment.Start = theDate

    objAppointment.Duration = 60

    objAppointment.Subject = "Complete Applicant Review"

    objAppointment.Body = "Make sure all feedback is complete and create feedback summary."

    objAppointment.Location = ""

    objAppointment.ReminderMinutesBeforeStart = 15

    objAppointment.ReminderSet = True

    objAppointment.Save

    End Sub

  • 11-04-2005 11:18 AM In reply to

    Re: objAppointment.Start w/ Field reference

    I responded on the other side...

    Cheers.

    Franck
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.