How to modify an AppointmentItem?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I got an AppointmentItem from an MAPIFolder and try to modify its fields. But
an exception occurred telling me that I had got no privilege to do this......

public void modifyItem(AppointmentItem item, CalItem calItem)
{
......
item.End = calItem.endTime; (Exception)
......
}
 
Where is this MAPIFolder? Is it in a PST file, your Exchange mailbox, a
delegate mailbox, public folder?

What are your permissions on that folder?

Can you perform any other operations on that appointment item? What is the
exact error?
 
That would be your default Calendar folder, either in a mailbox or a PST
file. If it's your own default folder you certainly should have permissions
on it. You can check on the permissions by selecting Folder List for the
Navigation Pane display and right-clicking on the Calendar folder and
selecting Properties. Go to the Permissions tab and see what permissions
your logon has.

Does this happen with all appointment items or only some? The only times
I've seen that sort of error message was if the user didn't have rights to
edit items in the folder.

Can you modify items in that folder manually, using the user interface?
 
Hi, Ken. Thanks for your help so far.
I've done some further tests and discovered that ONLY the "Start" and "End"
fields of an RECURRING AppointmentItem cannot be modified. Other fields of a
recurring item and all fields of a non-recurring item can be modified.
Are there possibilities that I can modify the "Start" and "End" fields?
 
For any appointment check for IsRecurring. If it is recurring use the
GetRecurrencePattern method to get the RecurrencePattern for the
appointment. Never reference that if it's not recurring, it will convert the
appointment into a recurring one.

Once you have the pattern you can get the master appointment as
RecurrencePattern.Parent. To get a specific occurrence use the
GetOccurrence(StartDate) method. Iterate the Exceptions collection to find
any existing exceptions and deleted occurrences. With the occurrence you can
then change start/end, which will add that appointment to the Exceptions
collection when you save the changes.

Look in the VBA Help for information and code snippets on working with those
methods and properties.
 
Back
Top