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