[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.interop

Howto add a new AppointmentItem to a MAPIFolder

Timothy Parez

10/12/2007 11:19:00 AM

Hi,

I have a piece of software which creates multiple calendars.
And then I get the MAPIFolder for a specific calendar like this:

MAPIFolder calendarFolder = this.GetOutlookFolder();

What MAPIFolder I get is defined by the properties in this class and
doesn't really matter here.
I get an existing MAPIFolder instance, and now I'd like to add
AppointmentItems to it.

calendarFolder.Items.Add(....) does not seem to work

And this:

AppointmentItem appointment =
(AppointmentItem)outlook.CreateItem(OlItemType.olAppointmentItem);
appointment.Save();

Doesn't seem to allow you to specify where to save it.

Am I missing something?

1 Answer

Timothy Parez

10/12/2007 12:41:00 PM

0

If this is the only way of adding an item to a folder:

AppointmentItem app =
(AppointmentItem)calendarFolder.Items.Add(OlItemType.olAppointmentItem);

And I want to add an existing instance of AppointmentItem to a folder,
what would mean I have to copy property by property?

app.Body = existingApp.Body;
app.Subject = existingApp.Subject;
app.AllDayEvent = existingApp.AllDayEvent;

etc.....

That's just crazy :)