 |
|
|
|
| Author |
Message |
Mk23
Joined: 04 Dec 2007 Posts: 5
|
Posted: Wed Feb 06, 2008 2:23 pm Post subject: Can't save AppointmentItem properties of recurrence appointm |
|
|
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?
Archived from group: microsoft>public>outlook>program_addins |
|
| Back to top |
|
 |
Dmitry Streblechenko
Joined: 12 Aug 2007 Posts: 220
|
Posted: Thu Feb 07, 2008 5:15 am Post subject: Re: Can't save AppointmentItem properties of recurrence appo |
|
|
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" wrote in message @microsoft.com...
> 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? |
|
| Back to top |
|
 |
Mk23
Joined: 04 Dec 2007 Posts: 5
|
Posted: Thu Feb 07, 2008 4:32 am Post subject: Re: Can't save AppointmentItem properties of recurrence appo |
|
|
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(); |
|
| Back to top |
|
 |
Dmitry Streblechenko
Joined: 12 Aug 2007 Posts: 220
|
Posted: Fri Feb 08, 2008 3:41 pm Post subject: Re: Can't save AppointmentItem properties of recurrence appo |
|
|
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" wrote in message @microsoft.com...
> 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();
> |
|
| Back to top |
|
 |
Mark J. McGinty
Joined: 13 Aug 2007 Posts: 8
|
Posted: Fri Feb 15, 2008 10:05 am Post subject: Re: Can't save AppointmentItem properties of recurrence appo |
|
|
"Dmitry Streblechenko" wrote in message @TK2MSFTNGP03.phx.gbl...
> 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" wrote in message
> @microsoft.com...
>> 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();
>>
>
>
|
|
| Back to top |
|
 |
|
|
| Related Topics: | Mailitem save as getting Operation Failed I created a OutLook Addinns using VSTO 2005 C# 2.0. the functionality is on right-click on any mail item, save onto sharepoint document lib. It's working fine when the subject got simple text. If the subject got special CHRs or if the mail was replied or
AppointmentItem.Move creates a copy? Anyone ever run in to this issue I'm seeing... I have some code that adds an appointment item, then calls Move to move it to the correct folder. Most of the time it is already in the correct folder, so the "Move" really doesn't do anything. Under previ
find an AppointmentItem I create and save by Visual Basic an Outlook So as to identify it I save an ID as and / or UserProperty. Creating and saving works just fine, but I don't find it again. I have tried: Set oNameSpace =
Create an appointmentItem Hi, I was asked to write an Outlook vba-macro that creates an appointment on the selected date/time. In detail: when the secretary plans appointments fot the consulants, she also plans travel time. This makes planning an appintment a lot of tasks: 1: expl
error with recurrence In my Outlook 2007 I have found that the system automatically sets a weekly recurrance of a single -scheduled event if I simply alter the color category. This seems to happen whether I open the event or use the right click shortcut "categorize." Has anyo |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|