PC Review


Reply
Thread Tools Rate Thread

Can't save AppointmentItem properties of recurrence appointment

 
 
Mk23
Guest
Posts: n/a
 
      6th Feb 2008
Hi

I have a problem by manipulating Appointment items properties. Our addin
manipulates the subject of appointmentItems. When i have a recurrence
appointment, and I manipulate the subject, an exception will be thrown.
(Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))

The magic thing is, that i can manipulate the subject and save it one time
(the recurrence appointment ist then shown as spli/exception appointment of
an serie) , but any further manipulation failed.

I read somewhere, that not all properties of an appointment that is
recurrence can be written. So I tried to set the new subject over the
recurrence pattern, but there is no property that offers an operation like
this. I also tried to set and save the subject only at the first appointment
of the recurrence, but the result was the same.

Has someone any idea?
 
Reply With Quote
 
 
 
 
Dmitry Streblechenko
Guest
Posts: n/a
 
      7th Feb 2008
Do you have any code snippets that exhibit that problem?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Mk23" <(E-Mail Removed)> wrote in message
news:31B94BBE-1EAB-4A2A-A025-(E-Mail Removed)...
> Hi
>
> I have a problem by manipulating Appointment items properties. Our addin
> manipulates the subject of appointmentItems. When i have a recurrence
> appointment, and I manipulate the subject, an exception will be thrown.
> (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))
>
> The magic thing is, that i can manipulate the subject and save it one time
> (the recurrence appointment ist then shown as spli/exception appointment
> of
> an serie) , but any further manipulation failed.
>
> I read somewhere, that not all properties of an appointment that is
> recurrence can be written. So I tried to set the new subject over the
> recurrence pattern, but there is no property that offers an operation like
> this. I also tried to set and save the subject only at the first
> appointment
> of the recurrence, but the result was the same.
>
> Has someone any idea?



 
Reply With Quote
 
Mk23
Guest
Posts: n/a
 
      7th Feb 2008
The code snippet:

// Prüfen, ob es sich um eine Terminserie handelt
bool isSerie = appointment.IsRecurring;

if (isSerie)
{
// Start and End DateTime
Outlook.RecurrencePattern pattern = appointment.GetRecurrencePattern();
pattern.StartTime = startDateTime;
pattern.EndTime = startDateTime + duration;
Marshal.ReleaseComObject(pattern);
pattern = null;
}
else
{
// Start and End DateTime
appointment.Start = startDateTime;
appointment.End = startDateTime + duration;
}

appointment.Subject = newSubject;
// Private Flag setzen falls Absenzcode entsprechend Konfiguriert ist
if ((privateAppointment == true) && (isSerie == false))
{
appointment.Sensitivity = Outlook.OlSensitivity.olPrivate;
}
appointment.Save();

 
Reply With Quote
 
Dmitry Streblechenko
Guest
Posts: n/a
 
      8th Feb 2008
Why do you make a distinction whether an appointment is recurring or not?
You should be able to set the Start and Duration properies on the
AppoointmentItem object.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Mk23" <(E-Mail Removed)> wrote in message
news:A06CC6D5-6A9A-4951-9DAF-(E-Mail Removed)...
> The code snippet:
>
> // Prüfen, ob es sich um eine Terminserie handelt
> bool isSerie = appointment.IsRecurring;
>
> if (isSerie)
> {
> // Start and End DateTime
> Outlook.RecurrencePattern pattern = appointment.GetRecurrencePattern();
> pattern.StartTime = startDateTime;
> pattern.EndTime = startDateTime + duration;
> Marshal.ReleaseComObject(pattern);
> pattern = null;
> }
> else
> {
> // Start and End DateTime
> appointment.Start = startDateTime;
> appointment.End = startDateTime + duration;
> }
>
> appointment.Subject = newSubject;
> // Private Flag setzen falls Absenzcode entsprechend Konfiguriert ist
> if ((privateAppointment == true) && (isSerie == false))
> {
> appointment.Sensitivity = Outlook.OlSensitivity.olPrivate;
> }
> appointment.Save();
>



 
Reply With Quote
 
Mark J. McGinty
Guest
Posts: n/a
 
      15th Feb 2008

"Dmitry Streblechenko" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Why do you make a distinction whether an appointment is recurring or not?
> You should be able to set the Start and Duration properies on the
> AppoointmentItem object.


Actually, you can't, OOM throws an illegal use of property/parameter (or
some such) if you attempt to assign Start, End, Duration and/or AllDayEvent
(all of which are inter-related, if you assign one, OOM floats the others to
fit.) *after* creating a recurrence pattern on the appointment.

When you alter a property of an occurrence [of a recurrent appointment] you
indirectly create an exception [to the recurrence pattern] but you cannot
create an exception from another exception, nor can you edit an exxception,
all you can do is remove it and then create another exception.

Occurrences and exceptions both occur in Items collections sometimes, they
look strikingly similar, but are quite different. Exceptions are children
of a recurrent event; occurrences are too, sort-of, the lines become a
little gray.

You can assign Start, End, et al *before* you create the recurrence pattern;
you can also remove the recurrence pattern, assign those fields and then
create recurrence again, but there's very little to gain from that, once the
recurrence pattern is created those properties aren't any more readable than
they are writable.

(Dmitry, I guess a career path of an industry-leading MAPIX expert tends to
swerve around OOM, but that route may have ended-up cheating you out of much
of the torture and mayhem that is OOM? Or maybe it's you that have cheated
OOM out of its many constraints?) :-)


-Mark



> Dmitry Streblechenko (MVP)
> http://www.dimastr.com/
> OutlookSpy - Outlook, CDO
> and MAPI Developer Tool
>
> "Mk23" <(E-Mail Removed)> wrote in message
> news:A06CC6D5-6A9A-4951-9DAF-(E-Mail Removed)...
>> The code snippet:
>>
>> // Prüfen, ob es sich um eine Terminserie handelt
>> bool isSerie = appointment.IsRecurring;
>>
>> if (isSerie)
>> {
>> // Start and End DateTime
>> Outlook.RecurrencePattern pattern =
>> appointment.GetRecurrencePattern();
>> pattern.StartTime = startDateTime;
>> pattern.EndTime = startDateTime + duration;
>> Marshal.ReleaseComObject(pattern);
>> pattern = null;
>> }
>> else
>> {
>> // Start and End DateTime
>> appointment.Start = startDateTime;
>> appointment.End = startDateTime + duration;
>> }
>>
>> appointment.Subject = newSubject;
>> // Private Flag setzen falls Absenzcode entsprechend Konfiguriert ist
>> if ((privateAppointment == true) && (isSerie == false))
>> {
>> appointment.Sensitivity = Outlook.OlSensitivity.olPrivate;
>> }
>> appointment.Save();
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Set AppointmentItem.Sensitivity in Recurrence Mk23 Microsoft Outlook Program Addins 0 20th Jun 2008 02:22 PM
Changing AppointmentItem.Subject split recurrence (series) Mk23 Microsoft Outlook Program Addins 3 8th Feb 2008 05:44 PM
Modifying AppointmentItem properties Andrew Dugdell Microsoft Outlook VBA Programming 8 29th Sep 2005 05:18 AM
Appointment/ task - recurrence - range of recurrence semut Microsoft Outlook VBA Programming 7 27th Jul 2005 04:01 AM
Appointment Recurrence egioka Microsoft Outlook Calendar 1 13th Oct 2003 09:13 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:22 AM.