Click to See Complete Forum and Search --> : Manipulating Outlook with client script


jscott
September 24th, 2002, 08:32 PM
I need to create an appointment in the Outlook Calendar but can't work out how to do it.
I've tried using the Outlook object model but I get a "Can't create automation object" error message on the following line of code:

var outlook = new ActiveXObject("Outlook.Application");

Why is this..? I do have Outlook installed locally.

I've also tried using CDO but can only get it to create a mail message - even when I use the sample code on MSDN I can't get it to create a calendar appointment. The code is as foolws for the mail message:

var CDOSession = new ActiveXObject("MAPI.Session");
CDOSession.Logon("wopy3s");

var oFolder = CDOSession.Outbox;
var oMessages = oFolder.Messages;
var oMsg = oMessages.Add;
var oRcpt = oMsg.Recipients;
oRcpt.Add("", "SMTP:jason.scott@woodside.com.au", 1);
oRcpt.Resolve();
oMsg.Subject = "Test Message";
oMsg.Text = "This is a test message...";
oMsg.Send();
CDOSession.Logoff();

Any help would be much appreciated....