Appointment/ task - recurrence - range of recurrence

  • Thread starter Thread starter semut
  • Start date Start date
S

semut

Hello,

I notice that Outlook will automatically calculate both

- Occurrences (integer)
- PatternEndDate (Date)


Even if I only select either one of it, say I select "End After" radio
button or "End By" radio button.

It is logic that both are calculatable even I have keyed in one of them.

The problem now is that how could I know what was the user selection?

Is the user select "End After" or "End By"?

Is there any field/properties in MAPI/CDO/OOM that I could tell what is the
selection?


thanks in advance.
 
In both cases mentioned in your posts there is no way to know what the user
has selected in the recurrence settings dialog. All you have to go on is the
actual recurrence pattern properties that are created.
 
Yes, that is what I have done, I am refering the RecurrencePattern object I
obtained throught the GetRecurrencePattern (The only way to get the
reccurence properties of an appointment item or task item) is through the
GetRecurrencePattern in OOM. Unless there are other method to go?

E.g.
Dim myRecurrPatt As Outlook.RecurrencePattern
'myAppItem is the item that I have keyed in into Outlook calendar
Set myRecurrPatt = myApptItem.GetRecurrencePattern


The 2 problems are actually refering the RecurrencePattern object that I
obtained

1. Outlook will automatically calculate both

- Occurrences (integer)
- PatternEndDate (Date)

Even if I have selected only one of it, say I select "End After XXXX
Occurrence" radio
button or "End By DD/MM/YYYY" radio button.

That means the Occurences and PatternEndDate field of "myRecurrPatt " will
always be filled up (unless the NoEndDate = true but not in this case as I
am not selecting No End Date).

I can't seems to be able to find other field to differentiate what was the
initial user choice (was user selected End After XXX occurrence / End By
MM/DD/YYYY?)



2.If i set my Task Item to be recurring Weekly - Regenerate 1 New task in
my Outlook 2003 task. When I use OOM to read the Task item, like

When I call

Set myRecurrPatt = myTaskItem.GetRecurrencePattern

if myRecurrPatt.RecurrenceType = olRecursWeekly Then
MsgBox "Nope, this wasn't called??"
end if

if myRecurrPatt.RecurrenceType = olRecursDaily Then
MsgBox "Yes, this was called?? Huh???"
end if

It has become RecursDaily and not olRecursWeekly which this will clash with
the case whereby user'task item is really recurring in olRecursDaily and
Regenerate 1 New task.

I have check through other combinations (recurrence pattern). All working
as mentioned in the Office VBA help files so far but left out these two odds
which giving me headache. Anyone encounter this before? Or these are again
another issues that require workaround like some other OOM functions?

Need pointers from gurus.

thanks in advance.
 
The only way to get the recurrence pattern is by GetRecurrencePattern. You
could read the recurrence pattern using MAPI to get the binary property, but
that buys you nothing and you won't have the recurrence properties at all,
you'd have to decode the binary.

As I said, there is nothing to get other than the pattern that was saved.
You have to use what's provided to you. The combination of all the pattern
properties lets you distinguish the complete pattern but not necessarily the
way the user created the pattern in the dialog.
 
Ken Slovak - said:
You could read the recurrence pattern using MAPI to get the binary
property, but that buys you nothing and you won't have the recurrence
properties at all, you'd have to decode the binary.

If you (the OP, not Ken) really have to know which sort of end type the
recurrence has, see

http://www.geocities.com/cainrandom/dev/MAPIRecurrence.html

which has that info halfway down; it's 22 bytes in, 0x21 for end-on-date,
0x22 for end-after-number-of-instances, 0x23 for never-ends. Oh, and it's
actually 22 plus some more bytes for offsets depending on the type of
recurrence. See that page for more.

-- dan
 
thanks

Ken Slovak - said:
The only way to get the recurrence pattern is by GetRecurrencePattern. You
could read the recurrence pattern using MAPI to get the binary property,
but that buys you nothing and you won't have the recurrence properties at
all, you'd have to decode the binary.

As I said, there is nothing to get other than the pattern that was saved.
You have to use what's provided to you. The combination of all the pattern
properties lets you distinguish the complete pattern but not necessarily
the way the user created the pattern in the dialog.
 
I have checked out the article.
that is a really good reference for MAPI recurrence pattern by the way.

thanks a bunch
 
Back
Top