VB Script in form fails when loading to Sharepoint - InfoPath Dev
in

InfoPath Dev

VB Script in form fails when loading to Sharepoint

Last post 11-07-2005 08:58 AM by Oleg Bespalov. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 11-04-2005 03:53 PM

    VB Script in form fails when loading to Sharepoint

    I have VB script code (Below) that is inside a button and is supposed to save a calendar appointment on the user's outlook. The form works fine when on my computer. But once I publish to sharepoint, and run a new form from there or edit the template, I get this error when pressing the button:

    "ActiveX component can't create object: 'Outlook.Application'
    File:script.vbs
    Line:32"


    Here is the code

    Dim objField

    Dim objField2

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

    Set objField2 = XDocument.DOM.selectSingleNode("//my:myFields/my:Name")

    if objField.text <> "" then

    Const olAppointmentItem = 1

    Set objOutlook = CreateObject("Outlook.Application")

    Set objAppointment = objOutlook.CreateItem(olAppointmentItem)

    dim theDate

    theDate = objField.text

    theDate = DateAdd("D", 7, theDate)

    theDate = theDate & " 9:00 AM"

    objAppointment.Start = theDate

    objAppointment.Duration = 60

    objAppointment.Subject = "Complete Applicant Review"

    objAppointment.Body = "Make sure all feedback for " & objField2.text & " is complete and create feedback summary."

    objAppointment.Location = ""

    objAppointment.ReminderMinutesBeforeStart = 15

    objAppointment.ReminderSet = True

    objAppointment.Save

    End if


  • 11-05-2005 12:32 AM In reply to

    Re: VB Script in form fails when loading to Sharepoint

    Hmmm. Outlook is installed right? Security issue?

    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    Project Manager at Qdabra
  • 11-07-2005 08:58 AM In reply to

    Re: VB Script in form fails when loading to Sharepoint

    Figured it out. sharepoint site needs to be added to list of trusted sites in IE to run Active X script.
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.