GetReccurrencePattern.Occurrences gives wrong number of occurrences

D

D. Lindner

Hello NG,

I have a problem with the export of Outlook-appointments to an
Excel-file. To export the recurring appointments correctly I have to
"extract" the number of occurrences of an recurring appointment-item
with the "ActualOccurrences =
myNameSpace.GetSharedDefaultFolder(UserName,
olFolderCalendar).Items(i).GetRecurrencePattern.Occurrences" command.
(I have splitted this into some smaller variables like "set MyCalendar
= myNameSpace.GetSharedDefaultFolder(UserName, olFolderCalendar)" and
so on.)
But the occurrence given differs sometimes (I didn't find out when or
how) to the right number of occurrences. But IF the difference occurs,
the retrieved number of occurrences every time is 10.

The occurrences are shown right
- in the calendar
- if I open the Item in Outlook and view the tab where the recurrences
are given
- if want to export the item under another user which is a recipient
(meeting)

For example:
Meeting between persons X and Y occurs z times.
- Context X returns
- Calendar: z
- Item in Outlook: z
- exporting: 10 (WRONG!)
- Context Y returns
- Calendar: z
- Item in Outlook: z
- exporting: z

Thanks in advance,
D. Lindner
 
K

Ken Slovak - [MVP - Outlook]

Is Items.IncludeRecurrences set to True?

Also have you looked at the Object Browser help and comments on that
property:

This property must be coordinated with other properties when setting
up a recurrence pattern. If the PatternEndDate property or the
Occurrences property is set, the pattern is considered to be finite
and the NoEndDate property is False. If neither PatternEndDate nor
Occurrences is set, the pattern is considered infinite and NoEndDate
is True.
 
D

D. Lindner

Hello Mr. Slowak,

the items have all been created in Outlook in the normal way - and not
with VB(A). And, yes, the Items.IncludeRecurrences is set to true.
(The export runs very well with about 99.9% of the other reccurrent
Appointments.)
I've had a look at the help, too. The properties you mentioned are set
correctly (NoEndDate is false, PatternEndDate is set and Occurrences
has a value). The thing is all other properties are "right", too. I
mean they are as the should be. - And I went through the object with
the "monitor-feature" or sth. like that (we use the german version of
Office 2k/XP) but sometimes the occurrences are wrong as I described
in my previous posting.

Thank you for your fast reply and kind regards,
D. Lindner
 
K

Ken Slovak - [MVP - Outlook]

The only thing I can think of is to try the code on another mailbox
and computer and see if you still have the same problems.
 

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