Hi,
I had sourced through the entire web for the past few days and does not seems to find anyone who is trying to do the same thing as me. This is interesting as i thought this should be quite useful.
Anyway, here is what i am trying to do:
I already have created an InfoPath Leave Form that allows employees to apply for vacation/leave from their manager. I only want to add an additional feature to allow the sender's calendar to be automatically added with the appointment (subsequently, i would like to add it to a public calendar in exchange).
I am currently using Office 2007. I got the following error [Automation server can't create object] when I using the following code:
//=======
// The following function handler is created by Microsoft Office InfoPath.
// Do not modify the name of the function, or the name and number of arguments.
//=======
function ADD_TO_CAL::OnClick(eventObj)
{
/* Set our values to be inserted into the Appointment */
newAppt = new appt("test subject", "this location", "05/26/2000 9:00 AM", "15");
/* Call our own function to save data */
saveAppt( newAppt );
}
/* Define Outlook constant for Appointment Item */
var olAppointmentItem = 1;
/* To add other Properties, refer to the Outlook Object Model */
function appt(Subject, Location, Start, ReminderMinutesBeforeStart)
{
this.Subject = Subject;
this.Location = Location;
this.Start = Start;
this.ReminderMinutesBeforeStart = ReminderMinutesBeforeStart;
}
function saveAppt(obj)
{
/* Create the Outlook Object and Appointment Item */
var out = new ActiveXObject("Outlook.Application"); <- The error points to this line
/* Create an Appointment Item */
appt = out.CreateItem(olAppointmentItem);
/* Transfer the data */
appt.Subject = obj.Subject;
appt.Location = obj.Location;
appt.Start = obj.Start;
appt.ReminderMinutesBeforeStart = obj.ReminderMinutesBeforeStart;
/* Save the data */
appt.Save();
}
I tried all 3 steps from this link -> http://support.microsoft.com/kb/832512 to no avail.
Long long time ago, 8 years back, I managed to integrate Outlook 97 to create a VB Form for submitting leave form and adding the appointment to the public calendar and outlook calendar. But now, 8 years later, i am unable to do it on Outlook 2007. Am I missing something? Can I don't use Sharepoint to acheive what I wanted?