Re: Resrict method + include reccurrences

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Mike Williams (mwilliams_at_mountainsoftware.co.uk)
Date: 06/04/04


Date: Fri, 4 Jun 2004 14:22:30 +0100

Sorry, I made a mistake copying my code.
I AM delimiting the string value in my code.
I find 1 item if I search without including recurrences (this is correct),
but 0 items are returned if I add the 2 lines for enabling reccurences.

Thanks for your help,

Mike Williams

"Ken Slovak - [MVP - Outlook]" <kenslovak@mvps.org> wrote in message
news:e5IJsBjSEHA.3140@tk2msftngp13.phx.gbl...
> User defined fields may not exist in the items themselves if they haven't
> been initialized with a value.
>
> You are not delimiting the string value for BillingInformation with either
> single or double quotes. It should look like this (extra spaces added to
> make the quotes stand out:
> string filter="[Billing Information]= 'Test Billing Information' ";
>
>
> --
> Ken Slovak
> [MVP - Outlook]
> http://www.slovaktech.com
> Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
> Reminder Manager, Extended Reminders, Attachment Options
> http://www.slovaktech.com/products.htm
>
>
> "Mike Williams" <mwilliams@mountainsoftware.co.uk> wrote in message
> news:eGqppoYSEHA.3968@TK2MSFTNGP09.phx.gbl...
> > I have a problem with using the item.Restrict method on an appointments
> > folder.
> >
> > The code i have works if the filter is on the "subject" field, but not
on
> > the "Billing Information" filed (or custom fields)
> >
> > The following code works beautifully -
> >
> > string filter="[Subject]='Test Subject'";
> >
> > Outlook.Items oItems=(Outlook.Items)folder.Items;
> >
> >
> > Outlook.Items oRestrictedItems=oItems.Restrict(filter);
> >
> > oRestrictedItems.Sort ("[Start]", false);
> >
> > oRestrictedItems.IncludeRecurrences = true;
> >
> > int count=0;
> >
> > foreach (Outlook.AppointmentItem item in oRestrictedItems)
> >
> > {
> >
> > count++;
> >
> > }
> >
> > MessageBox.Show(count.ToString());
> >
> > It also works fine if I replace the first line with
> >
> > string filter="[Billing Information]=Test Billing Information";
> >
> > and comment out the Sort and IncludeReccurences lines. (but I get a
counrt
> > of 1 item)
> >
> > If I have the billing info search criteria AND the IncludeRecurrences, I
> get
> > a count of 0
> >
> >
> >
> > Thanks in advance for any help
> >
> >
> >
> > Mike Williams
> >
> >
>
>



Relevant Pages

  • Re: Update existing values incrementally w/UPDATE SQL
    ... I think it would be safe to say, use the Dim statement any time you are ... Dim basically tells vba that you want to initiate a new variable. ... As far as quotes go, this was one of the trickiest ... Consider vba's interpretation of a string: ...
    (microsoft.public.access.modulesdaovba)
  • Re: Update existing values incrementally w/UPDATE SQL
    ... and in the book; Access 2007 VBA Programmer's Reference. ... As far as quotes go, this was one of the trickiest ... Consider vba's interpretation of a string: ... when an SQL is processed (I use an SQL example because it is the most ...
    (microsoft.public.access.modulesdaovba)
  • Re: Update existing values incrementally w/UPDATE SQL
    ... pretend that Me.txtString is a control on your form, ... You cant put Me.txtString inside the double quotes, or VBA just reads it as a ... and in the book; Access 2007 VBA Programmer's Reference. ... when an SQL is processed (I use an SQL example because it is the most ...
    (microsoft.public.access.modulesdaovba)
  • Re: Need to use 2 fields in link criteria
    ... quote around SSN so that the full SQL string has the SSN as a literal ... there is intervening text within the quotes. ... > Hi Bonnie, ...
    (microsoft.public.access.formscoding)
  • Re: SQL WHERE STMT PROBLEM
    ... is defined as a String variable, it is therefore not possible for it to ever ... possibly assign the value "False" to the BsSql variable. ... Dim oRst As DAO.Recordset ... > single and dbl quotes as instructed to produce the above BsSql ...
    (microsoft.public.access.queries)