Re: Resrict method + include reccurrences
From: Mike Williams (mwilliams_at_mountainsoftware.co.uk)
Date: 06/04/04
- Next message: Ken Slovak - [MVP - Outlook]: "Re: Resrict method + include reccurrences"
- Previous message: Sue Mosher [MVP-Outlook]: "Re: automatic send email with task"
- In reply to: Ken Slovak - [MVP - Outlook]: "Re: Resrict method + include reccurrences"
- Next in thread: Ken Slovak - [MVP - Outlook]: "Re: Resrict method + include reccurrences"
- Reply: Ken Slovak - [MVP - Outlook]: "Re: Resrict method + include reccurrences"
- Messages sorted by: [ date ] [ thread ]
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
> >
> >
>
>
- Next message: Ken Slovak - [MVP - Outlook]: "Re: Resrict method + include reccurrences"
- Previous message: Sue Mosher [MVP-Outlook]: "Re: automatic send email with task"
- In reply to: Ken Slovak - [MVP - Outlook]: "Re: Resrict method + include reccurrences"
- Next in thread: Ken Slovak - [MVP - Outlook]: "Re: Resrict method + include reccurrences"
- Reply: Ken Slovak - [MVP - Outlook]: "Re: Resrict method + include reccurrences"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|