Check the value of the RecurrenceState property, and if it is
olApptOccurrence or olApptException, use the master appointment instead
(will be returned by AppointmentItem.Parent)
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
"Mark Beiley" <nowhere AT donotuse.com> wrote in message
Hi Dmitry,
This should be either a master or non-recurring appointment. I will
add
some code in my catch block to query 'RecurrenceState' to make sure.
I'll post the results once I get them (I have to wait for my customer
to
reproduce this for me...).
Thanks,
Mark
--
Beiley Software
http://www.beiley.com
Are you really trying to change AllDayEvent for an instance of a
recurring activity, not the master appointment??
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
"Mark Beiley" <nowhere AT donotuse.com> wrote in message
When trying to set the AllDayEvent to 0, Outlook throws this
exception:
Exception 0xc6204005 from Microsoft Office Outlook
Error Desc: You don't have the permission to move this item.
They are using a local .pst file, so they should have permission.
The
error always seems to happen on the same specific event. Any ideas?
Thanks,
Mark
--
Beiley Software
http://www.beiley.com
"Mark Beiley" <nowhere AT donotuse.com> wrote in message
Hi Dmitry,
I found a class '_com_error', which will capture information thrown
by Outlook. It has both an error number and a description.
I've added this into my catch block, and hopefully this will give
more
information on what the problem is. (I have to wait for my
customer
who is
experiencing this problem, I can't reproduce it here...)
I'll post the results once I get them.
That error message will include the phrase, "invalid property
assignment."
Assigning the AllDayEvent property will throw an error if a
recurrence pattern has been defined for the AppointmentItem, you can
test the IsRecurring property to check for this. (The same applies
to the Start and End properties, assignments to them are invalid if
the item is recurring.)
Correspondingly, the AllDayEvent flag is ignored for recurring
items,
the duration is set for 24 hours, but the event starts (according to
Outlook) at midnight in the system-configured time zone, when
recurrence is defined. Example: while living on the east coast, you
create a recurrent event for your wife's birthday; you then move to
the west coast, and change your system's time zone accordingly; the
event for your wife's birthday now starts at 9:00 PM on the day
prior.
Conversely, a non-recurring item flagged as as AllDayEvent starts at
midnight in the system's time zone, no matter what that time zone
is,
and it does not change if the timezone changes.
(Technically, the underlying value [stored as UTC] does not change
for recurrent items, it's just the displayed value that adjusts.
For
non-recurring AllDayEvents, Outlook *might* actually change the
underlying UTC value to adjust it to display as midnight in the new
time zone, but if it does, it does so without changing
LastModificationTime. I'd have to go underneath OOM, and read the
value [before and after changing time zones] using Redemption to
know
for sure... too lazy to do that at the moment.)
-Mark
Thanks,
Mark
--
Beiley Software
http://www.beiley.com
"Mark Beiley" <nowhere AT donotuse.com> wrote in message
Hi Dmitry,
I don't log any exception details in the catch block. Honestly,
I'm not
sure how, but I can probably research it and figure out how. What
sort of
details are available that would be helpful for logging in the
catch
block? Do you know if there is some error message or code set
somewhere
when Outlook throws an exception?
It gets raised immediately. I only have this one line of code in
the try
block.
I'm pretty sure the olAppt is valid and an appointment item. I'm
enumerating through items in the calendar folder. I successfully
use it
right before this to set other properties like Body and Location.
Thanks,
Mark
--
Beiley Software
http://www.beiley.com
Do you log the exception details in your catch() block? Does the
error
get raised immediately or only after you process a few items?
Where does
olAppt come from? Are you sure it is an AppointmentItem object
and
not
something else?
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
"Mark Beiley" <nowhere AT donotuse.com> wrote in message
Hi Dmitry,
I don't see any error message... I have this in a try/catch
block and
Outlook throws an exception when I try and set AllDayEvent. My
code
looks like this:
try
{
olAppt->AllDayEvent = 0;
}
catch(...)
{
// do some error logging...
}
I'm writing my add-in in C++. Is there some way I can get some
sort of
error message from Outlook? I really have no indication of
'why'
it is
failing, I just know where it fails.
Thanks,
Mark
--
Beiley Software
http://www.beiley.com
And what is the exact error message?
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
"Mark Beiley" <nowhere AT donotuse.com> wrote in message
I have an add-in that is modifying the properties of a calendar
event.
When it gets here:
olAppt->AllDayEvent = 0;
Outlook is throwing an exception. This code works fine on
most
events, but on some events this will fail. Any ideas why this
would
fail? Is there some other property I need to make sure to set
first
or something?
Thanks,
Mark