How to code with a shared calendar?

  • Thread starter Thread starter Normand
  • Start date Start date
N

Normand

Hi,

I’m actually working on a project where I need to automate actions on both
Outlook/exchange versions 2003 and 2007 shared web calendars.

My goal is to display a web version of an shared calendar and add a meeting
with a script to a shared calendar.

Here follows what I have done so far but with relatively no success:

out = new ActiveXObject( "Outlook.Application" );

appt = out.CreateItem( olAppointmentItem );
appt.Subject = "rendez-vous";
appt.Location = "dans la salle X";
appt.Start = "07/25/2008 10:00 AM";
appt.end = "07/25/2008 11:30 AM";
appt.body = "Unrendez-vous X";
appt.Attachments.add("C:\\Users\\nlemay\\Documents\\bob.txt",1, 1, "test");
appt.ReminderMinutesBeforeStart = "15";
appt.save();

I use that code to see my calendar :
<OBJECT classid=CLSID:0006F063-0000-0000-C000-000000000046
id=ViewCtlFolder width="50%" height="100%">
<param name="Folder" value="\\Boîte aux lettres - Normand
Lemay\Calendrier">
<param name="Namespace" value="MAPI">
</OBJECT>


Your help would be greatly appreciated.

Normand
 
Aside from the fact that Outlook isn't an ActiveX control and you usually
create a new Outlook.Application instance using CreateObject() or New, what
problems are you having? Your message doesn't say where the code is failing,
or what's failing.

Where is this code intended to run, in a Web server context or locally on
the user's machine where Outlook is actually installed? This looks like C#
code, is it running locally or server side? What context is it running in
(COM Addin, standalone code, etc.).
 
Hello Ken,
First, I must point out that I’m an experienced PL/SQL programmer that has
no knowledge of Outlook programming and we’re trying to find a way to add
Outlook appointments from an Oracle Forms application. So far we have tried
to do this using a web page with html and javascript code.

Let me explain what I’m aiming for.
By opening this web page that contains buttons that opens all the private
shared calendars that a user has access to (one button for each shared
calendar), I want to:
Show that person calendar in my web page
Click on a button on that page that will open that standard Outlook “add an
appointment†window
When I’m finished creating that appointment, save it to add it in that
calendar and see this new appointment in my web version of the calendar (that
person will now have this appointment also in his/her Outlook calendar
Close that calendar and repeat this task with all my other users shared
calendars

So far, I manage to make all this work successfully using my own calendar.

Thus my problem is that I can’t open someone else private shared calendar
and edit its appointments.

So what I need to learn is to how to address a shared calendar to:

Display that calendar in a web page
Add an appointment to it
And edit an existing appointment would also be nice to do if possible

Thank you for taking the time to answer me.

Normand
 
Any Outlook code has to run client side where Outlook is installed. It can't
run server side. So you have to get the user to download the code and run it
there and communicate with the Web server.

If you wanted to display a Web page in Outlook you could do so using a
folder home page as the "face" of an Outlook folder. But the Outlook code
still has to run client side.

A good site with a wealth of Outlook programming information is
www.outlookcode.com.

All folder access in Outlook is through the NameSpace object and its Folders
collection. Default folders such as Calendar can be accessed directly using
the NameSpace.GetDefaultFolder(olFolderCalendar) method.

Shared folders are accessed using NameSpace.GetSharedDefaultFolder().

The Obect Browser in the Outlook VBA project has examples of using most
methods, although the code is usually VBA.

The Outlook 2003 object model has no special access for Web calendars. There
is support for that in the Outlook 2007 object model.

Where in Outlook are these shared calendars displayed, or are they available
from Web services or a central Web location?
 
Hi Normand. I am about to start a project similar to the one you are
describing, and I am hoping you get get me started on it. We have several
conference rooms with shared outlook calendars, and I need to have them
displayed on our intranet, only I do not know where to start. I will also
need to schedule appointments on those calendars as well. It seems like you
have a pretty good handle on this, and I am hoping that you can give me some
direction.
 
Hi Adam,

I use that code to view outlook :
<object id="calendar" classid="clsid:0006F063-0000-0000-C000-000000000046"
id="OVCWPQ1"
codebase="http://activex.microsoft.com/activex/controls/office/outlctlx.CAB#ver=9,0,0,3203" width="50%" height="100%">
<param name="Folder" value="Calendar"/>
<param name="Namespace" value="MAPI"/>
</object>

this is my code to save a appointement:
var currentDate = new Date();
var olAppointmentItem = 1;
var user_view = "XXX YYYY";
var out = new ActiveXObject( "Outlook.Application" );
var myNameSpace = out.GetNameSpace("MAPI");
var myRecipient = myNameSpace.CreateRecipient(user_view);
myRecipient.Resolve;
CalendarFolder =
myNameSpace.GetSharedDefaultFolder(myRecipient,9);

appt = CalendarFolder.items.add;
appt.Subject = "Test de rendez-vous";
appt.Location = "dans une maison";
appt.Start = "08/18/2008 13:30";
appt.end = "08/18/2008 14:30";
appt.body = " Rien pour le moment";
appt.save();

and I use this code to change view:
user_view = document.form1.user.value;
myRecipient = myNameSpace.CreateRecipient(user_view);
var olFolderCalendar = 9;
var viewCtlFolder = document.getElementById('ViewCtlFolder');
viewCtlFolder.OpenSharedDefaultFolder(user_view,
olFolderCalendar);
 
Back
Top