ItemChange: How to recognize a reminder?

  • Thread starter Thread starter Gunnar Syren
  • Start date Start date
G

Gunnar Syren

I have written a program that syncronizes Outlook with a CIS system so your
status in the CIS system is set to busy when you're in a meeting, meaning
you don't get any phone calls routed to you.

For some reason I run into trouble sometimes when a user clicks "Dismiss"
on a reminder (the problem is not in Outlook but in updating the database
for the CIS).

I have noticed that dismissing a reminder triggers the ItemChange event for
that appointment. I would like to ignore ItemChange events that are
triggered by reminders, and only process those that actually reflect
changes to the appointment. But I have not been able to find a way to
distinguish events triggered by the reminder.

Can anyone help?
 
Dismissing a reminder on an appointment item does change the original
item, it changes the FlagDueBy property to 1/1/4501. So ItemChange is
firing correctly. You could check for that property having been set to
that date value in your code.

To check FlagDueBy you'd have to use either CDO 1.21 (an optional
installation from the Office CD for Outlook 2000 and later), Extended
MAPI (C++ or Delphi code only) or Redemption
(www.dimastr.com/redemption). Using one of those you would look at the
value of the property FlagDueBy
({00062008-0000-0000-C000-000000000046}0x8560)
 
Be aware that the date 1/1/4501 may also be represented by a different
string depending on the user's regional settings. I ran into this when I
was testing for this date on a date field. Work wonderfully on my machine.
Didn't work on another's because their date looked like 01/01/4501. Someone
suggested to me to use the month, day, year functions to pull the date out
to ensure the regional settings do not create a problem.

--
Tony Murnion
AZ Technology Solutions, Inc.

http://www.azworld.com/services/computer.html
 
The property is a datetime property, not a string, so the locale settings do
not apply. 1/1/4501 is Outlook's way of saying "this property is not set"
for the datetime properties.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
Comparing to #1/1/4501# (forcing a date value rather than a string
value) should take care of any localization issues also.
 
So how do you test that the value is = 1/1/4501? Maybe I'm using something
wrong. Here is the code I have in order to make it work in both cases:

If item.userproperties.find("DataVerifiedDate").value = "1/1/4501" OR
item.userproperties.find("DataVerifiedDate").value = "01/01/4501" then



--
Tony Murnion
AZ Technology Solutions, Inc.

http://www.azworld.com/services/computer.html
 
Add the user property as olDateTime rather than olText, then the check is as
easy as
If item.userproperties.find("DataVerifiedDate").value = #1/1/4501#

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