最近在一个朋友的帮助下,研究了下用js调用ActiveX发outlook的meeting request的方法,在这里记录下。
<script type="text/javascript">
function objappt(Subject, Start, Location, End, RequiredAttendees) {
var objOL //As Outlook.Application;
var objAppt //As Outlook.AppointmentItem;
var olAppointmentItem = 1;
var olMeeting = 1;
objOL = new ActiveXObject("Outlook.Application");
// nameSpace = objOL.getNameSpace("MAPI");
//apptFolder = nameSpace.getDefaultFolder(9);
objappt = objOL.CreateItem(olAppointmentItem);
// With objappt;
objappt.Subject = "My Test";
objappt.Start = "1/23/2010 9:00 AM";
objappt.End = "1/23/2010 9:45 AM";
// make it a meeting request;
objappt.MeetingStatus = olMeeting;
objappt.Location = "meeting room";
objappt.RequiredAttendees = "someone@xxx.dom";
iRec = objappt.GetRecurrencePattern();
objRecurPattern = objappt.GetRecurrencePattern;
objRecurPattern.RecurrenceType = 3;
objRecurPattern.Interval = 1;
objRecurPattern.PatternStartDate ="12/19/2005";
//objappt.MeetingStatus = 1;
objappt.Save();
objappt.Display();
// End With;
objAppt = null;
objOL = null
}
</script>
<html>
<head><title>
</title></head>
<body ></body>
<input type=button onclick="javascript:objappt('','','','','');">