CDO Update problem

J

John Galt

I have a VBA application that reads contacts from outlook, sends a fax and
updates the following contact fields:

1. CdoPR_BODY - Used as a text long of action taken i.e.
"YYYY-mm-dd - Auto fax sent"
2. CdoPR_RTF_SYNC_BODY_TAG - Used to sync CdoPR_BODY
3. CdoPR_REPLY_TIME - The Flagged reminder Date & Time to send the
next fax.

The problem I am having is that when I set the value of CdoPR_REPLY_TIME
and do the update it appears to work correctly.

When I open Outlook and review the updated contact the following occurs:
1. The contact reminder time is the same as it was prior to the
update.
2. The color is black (not over due) even though the old date / time
showing are past due.
3. I open the contact and click the reminder flag button and the
correct date an time updated via the program are there.


Does anyone have any clue as to what I need to do to sync my VBA CDO session
and MS Outlook?

Please help if you can.

Thanks in advance.
 
K

Ken Slovak - [MVP - Outlook]

PR_REPLY_TIME has nothing to do with reminders and their times. It's
the time that a reply to an original message was sent out.

For reminders you need to set 4 properties on an item: ReminderSet,
ReminderTime, FlagDueBy and FlagRequest. In the case of a mail item
type ReminderTime and FlagDueBy would be the same.
ReminderMinutesBefore doesn't have to be set for mail type items.

FlagRequest would have text like "For Followup", it's a PT_STRING8,
ReminderSet is Boolean and the other 2 are PT_SYSTIME. See
www.cdolive.com/cdo10.htm for the undocumented property tags you need
to use to access those properties. Also, if you have OutlookSpy, which
you should have if you are doing coding like this (www.dimastr.com)
then set a reminder on an item and look at the item in OutlookSpy to
see how the properties look. Remember that when viewing the date/time
properties they will be viewed in GMT and would be converted into
local time when read in Outlook or CDO code.
 
J

John Galt

Ken,

I understand the other Flag and text fields. They are already set to
Flagged and "Send Fax" so I do not heed to update them.

If your info is correct - Why is it that when I Update PR_REPLY_TIME and
then I look at it in Outlook in the contact form (press red flag) the date
has changed.
Also when I look at the reminder date in the contact view list (all contacts
listed by category) the color of the item is now black but the old date
remains??
 
K

Ken Slovak - [MVP - Outlook]

A red item does change to black when I change PR_REPLY_TIME and that
changes the displayed reminder time when clicking on the Flag icon,
but it doesn't seem to actually change the time the reminder fires.

I set a reminder for 5:00 PM today on a contact item. I then used
OutlookSpy to change PR_REPLY_TIME to 4:37 PM today. The reminder
dialog for the contact item then showed 4:37 PM but the reminder did
not fire at 4:37. When I changed FlagDueBy from 5:00 PM to 4:41 PM the
reminder fired at 4:41 PM.

If you snooze a reminder when it fires the new reminder time is only
reflected in FlagDueBy, and that's when the reminder fires again.

I use the fields I mentioned earlier when I work with reminders and
things seem to work properly, at least for me and my customers.
 
J

John Galt

Well after experimenting a bit I came to the conclusion that syncing up
PR_reply_time, Flag_Due_BY
and Flag_Due_by_Next I was able to get the behavior I wanted. Including the
red/black issue.

Interesting exercise.

Ken thanks for your help. It forced me to dig a little deeper and gain a
better understanding.
 
K

Ken Slovak - [MVP - Outlook]

Reminders and the various properties and settings for them are
interesting and frustrating too, since so much is undocumented. I've
spent a couple of years off an on in figuring them out, and recurring
appointments are the worst.

Of course by now you're aware that the PR_REPLY_TIME property only
applies to contacts and email items. Tasks and appointments don't have
or use that property.

One day MS will give us what we've been requesting for years now, a
fully orthogonal Outlook object model that exposes all the properties
we need. It's very frustrating to not see the needed reminder
settings, among other things, for all the Outlook items that support
reminders. Maybe now that Randy Byrne is in charge of programmability
of the Outlook object model we'll get what we want in Outlook 12.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top