Period Restriction 
Author Message
 Period Restriction

Hello,

I have a not-ended recurring appointment, but I've set a Restriction from
date1 to date2.

When I launch the analysis, it does not stop at date2... I wish it did !

Is this ok, or isn't it possible to treat an unkown recurring appointment
with no end date ?

Thank you



Fri, 15 Apr 2005 03:51:04 GMT  
 Period Restriction
You'll have to provide a little more information -- like what kind of
analysis you're doing and what you mean by "treat an unkown recurring
appointment."

--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
     Microsoft Outlook Programming: Jumpstart
     for Administrators, Power Users, and Developers
     http://www.slipstick.com/books/jumpstart.htm


Quote:
> Hello,

> I have a not-ended recurring appointment, but I've set a Restriction from
> date1 to date2.

> When I launch the analysis, it does not stop at date2... I wish it did !

> Is this ok, or isn't it possible to treat an unkown recurring appointment
> with no end date ?

> Thank you



Fri, 15 Apr 2005 05:15:20 GMT  
 Period Restriction
So here it is :

My Exchange server contains about 200 accounts and in these accounts there
are a lot of appointments (I think about 3 or 4 per day).

My job consists in extracting the informations about the appointments
(date, hour, subject) and put it in a text file. However I have two dates
for starting and ending the job i.e. (01/01/2002 and 31/12/2002)

Some of the appointments are recurring. And some of them are non-ended
recurring.

In my code, I do something like that :

AppointmentsColl.Sort('[Start]');
AppointmentsColl.Restrict('[Start] > ''' +StartDate +''' And [Start] < '''
+EndDate +''');

AppointmentsColl.GetOccurrences = True;

And after that I do a for...each to extract all of the appointments (also
the instances of a recurring appointment).

I must say that I DO NEED to extract all the instances of an appointment
(because the subjects may have been modified).

The problem is that when I launch the program, it never stops. It loops on
the first non-ended recurring appointment it finds and doesn't not stop at
EndDate at all.

What do I have to do ?

Thank you.



Fri, 15 Apr 2005 16:35:08 GMT  
 Period Restriction
I think you mean IncludeRecurrences instead of GetRecurrences. You didn't
show us what kind of loop you're using to work with the collection returned
by Restrict.

--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
     Microsoft Outlook Programming: Jumpstart
     for Administrators, Power Users, and Developers
     http://www.slipstick.com/books/jumpstart.htm


Quote:
> So here it is :

> My Exchange server contains about 200 accounts and in these accounts there
> are a lot of appointments (I think about 3 or 4 per day).

> My job consists in extracting the informations about the appointments
> (date, hour, subject) and put it in a text file. However I have two dates
> for starting and ending the job i.e. (01/01/2002 and 31/12/2002)

> Some of the appointments are recurring. And some of them are non-ended
> recurring.

> In my code, I do something like that :

> AppointmentsColl.Sort('[Start]');
> AppointmentsColl.Restrict('[Start] > ''' +StartDate +''' And [Start] < '''
> +EndDate +''');

> AppointmentsColl.GetOccurrences = True;

> And after that I do a for...each to extract all of the appointments (also
> the instances of a recurring appointment).

> I must say that I DO NEED to extract all the instances of an appointment
> (because the subjects may have been modified).

> The problem is that when I launch the program, it never stops. It loops on
> the first non-ended recurring appointment it finds and doesn't not stop at
> EndDate at all.

> What do I have to do ?

> Thank you.



Fri, 15 Apr 2005 18:40:59 GMT  
 Period Restriction

ses petits doigts-doigts :

Quote:
> I think you mean IncludeRecurrences instead of GetRecurrences. You
> didn't show us what kind of loop you're using to work with the
> collection returned by Restrict.

> --

Ok, so here's the code (delphi)

calendrierProfil.Sort('[Start]');
calendrierProfil.IncludeRecurrences := True;
calendrierProfil.Restrict('[Start] >= ''' +DateToStr(debutPeriode) +'
00:01 AM'' And [Start] <= ''' +DateTimeToStr(finPeriode) +' 23:59 PM''');

//        writeln(fichierExport, '[Start] >= ''' +DateToStr(debutPeriode)
+' 00:01 AM'' And [Start] <= ''' +DateTimeToStr(finPeriode) +' 23:59
PM''');

Enum := TEnumVariant.create(calendrierProfil);

while(Enum.ForEach(rdv)) do
begin
        writeln(fichierExport, rdv.subject);
end;

it's like a :
        for each rdv in Enum loop ... end loop;

You see, I restrict on two dates, then I includeRecurrences (sorry for
the mistake, I didn't remember...), then I extract.

Is it enough ?

Thank you



Fri, 15 Apr 2005 21:12:48 GMT  
 Period Restriction
I'll ask Dmitry to come over and take a look, since he's the resident Delphi
expert.  Can you give us an example of what your Restrict string actually
looks like with all the terms evaluated? (FWIW, I always build the Restrict
string separately, rather than within the Restrict statement itself -- makes
it much easier to debug.)

--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
     Microsoft Outlook Programming: Jumpstart
     for Administrators, Power Users, and Developers
     http://www.slipstick.com/books/jumpstart.htm


Quote:

> ses petits doigts-doigts :

> > I think you mean IncludeRecurrences instead of GetRecurrences. You
> > didn't show us what kind of loop you're using to work with the
> > collection returned by Restrict.

> > --

> Ok, so here's the code (delphi)

> calendrierProfil.Sort('[Start]');
> calendrierProfil.IncludeRecurrences := True;
> calendrierProfil.Restrict('[Start] >= ''' +DateToStr(debutPeriode) +'
> 00:01 AM'' And [Start] <= ''' +DateTimeToStr(finPeriode) +' 23:59 PM''');

> //        writeln(fichierExport, '[Start] >= ''' +DateToStr(debutPeriode)
> +' 00:01 AM'' And [Start] <= ''' +DateTimeToStr(finPeriode) +' 23:59
> PM''');

> Enum := TEnumVariant.create(calendrierProfil);

> while(Enum.ForEach(rdv)) do
> begin
>     writeln(fichierExport, rdv.subject);
> end;

> it's like a :
>     for each rdv in Enum loop ... end loop;

> You see, I restrict on two dates, then I includeRecurrences (sorry for
> the mistake, I didn't remember...), then I extract.

> Is it enough ?

> Thank you



Fri, 15 Apr 2005 21:33:39 GMT  
 Period Restriction

ses petits doigts-doigts :

Quote:
> I'll ask Dmitry to come over and take a look, since he's the resident
> Delphi expert.  Can you give us an example of what your Restrict
> string actually looks like with all the terms evaluated? (FWIW, I
> always build the Restrict string separately, rather than within the
> Restrict statement itself -- makes it much easier to debug.)

yes you're right...

Here is my typical restriction string :
"[Start] >= '01/01/2002 00:01 AM' And [Start] <= '31/12/2002 23:59 PM'"

And I made the test with this appointment :

Start : 12/10/2002 13:00
End : 12/10/2002 13:15
Recurrent : YES
Recurrency end date : no end date
RecurrencePattern : Every Saturday

Here is the result of my extract :

12/10/2002;13:00;"Test de recurrence"
26/10/2002;13:00;"Test de recurrence"
02/11/2002;13:00;"Test de recurrence"
09/11/2002;13:00;"Test de recurrence"
16/11/2002;13:00;"Test de recurrence"
...
28/12/2002;13:00;"Test de recurrence"
04/01/2003;13:00;"Test de recurrence"

And sometimes, when I try with an appointment starting on 15/10, I get
the same thing... without the 31/12 occurence.



Sat, 16 Apr 2005 01:41:38 GMT  
 Period Restriction
How is TEnumVariant class implemented?

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


Quote:

> ses petits doigts-doigts :

> > I think you mean IncludeRecurrences instead of GetRecurrences. You
> > didn't show us what kind of loop you're using to work with the
> > collection returned by Restrict.

> > --

> Ok, so here's the code (delphi)

> calendrierProfil.Sort('[Start]');
> calendrierProfil.IncludeRecurrences := True;
> calendrierProfil.Restrict('[Start] >= ''' +DateToStr(debutPeriode) +'
> 00:01 AM'' And [Start] <= ''' +DateTimeToStr(finPeriode) +' 23:59 PM''');

> //        writeln(fichierExport, '[Start] >= ''' +DateToStr(debutPeriode)
> +' 00:01 AM'' And [Start] <= ''' +DateTimeToStr(finPeriode) +' 23:59
> PM''');

> Enum := TEnumVariant.create(calendrierProfil);

> while(Enum.ForEach(rdv)) do
> begin
>     writeln(fichierExport, rdv.subject);
> end;

> it's like a :
>     for each rdv in Enum loop ... end loop;

> You see, I restrict on two dates, then I includeRecurrences (sorry for
> the mistake, I didn't remember...), then I extract.

> Is it enough ?

> Thank you



Sat, 16 Apr 2005 02:45:56 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. Calculate days within a period range

2. Coverage Periods

3. Period vs Slash in Dates

4. Help with Date calcualtion - Number of days resident in period

5. How to find the message reply period?

6. Show a form for a set period of time

7. msgbox align text and display for period of time

8. Create contacts from emails received during a specific time period

9. Report for a specific period

10. Any way to enumerate Calendar Periods ?

11. automatic capitalization after period

12. Make sure there are two spaces after every period

 

 
Powered by phpBB® Forum Software