How to save new AppointmentItem in a shared folder?

B

Boris

Hello,

I am writing add-in for outlook 2003 in VB.NET, and trying to save
created AppointmentItem in shared calendar. It works, but on some
machines new item gets saved in local calendar instead of the shared
one.

I have MAPIFolder object for the shared calendar. I am creating new
item using MAPIFolder.Items.Add method:

objNewItem = objFolder.Items.Add(Outlook.OlItemType.olAppointmentItem)

Then I set fields, including RequiredAttendies, and save it:

objNewItem.Save()

Then I send the appointment to the RequiredAttendies:

objNewItem.Send()

Also, I have a handler for objNewItem.Write event, where I check the
folder it writes to. I use objNewItem.Parent.FolderPath to check it.

For the machines where it works, Save() method writes objNewItem into
\\MyUsername\Calendar (local calendar), as far as I can see it under
..Write event. Then Send() method writes something twice to
\\Shared\Calendar (shared calendar). Probably there is some event, or
internal action, after Save() method which actually writes the
appointment to the shared calendar. I supposed to see all writes to the
folder where I have created objNewItem, however I have new item saved
in the shared calendar and nothing in local one.

For the machines where it does not work I have all three .Write events
to \\MyUsername\Calendar (local calendar). And finally new item is in
local calendar.

I tried creating new Item using CreateItemFromTemplate() method:
objNewItem =
objApplication.CreateItemFromTemplate(objOutlookTemplateFile,
objFolder)
But the result is exactly the same.

Am I doing something wrong here? Is there any other, more reliable
method to create and store Item in the shared folder? How Save() method
works and why I am getting write events to local calendar?


Thanks a lot for any reply,
Boris.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top