Re: Find flagstatus



Hi,

Could you give me a example to do so?
I'm stuck and don't have a clue where to start....

Which property "[xxx]" should I give in the Find function?
Where can I find every possible property that I can use in the Find
function?

I wouldn't ask you this if the folder where I should find these mailitems
wasn't so big.
The current script loops thru every +1000 mailitems to find the 20 items
that aren't flagged. (time and processor consuming function)
So that's why I want to narrow down the result by using "Find" and
"FindNext"


TIA.
PascalB




"Sue Mosher [MVP-Outlook]" <suemvp@xxxxxxxxxxxxxxx> wrote in message
news:%237d1A8jGIHA.284@xxxxxxxxxxxxxxxxxxxxxxx
Could this be done be a simple search and find; perhaps some kind of
filter
or query!?

Yes, that's what the Items.Find and .Restrict methods are for.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"PascalB" <pascal.bourgeoisSP@xxxxxxxxxxxxxx> wrote in message
news:%233iIcCjGIHA.1316@xxxxxxxxxxxxxxxxxxxxxxx
Hi,

Thanks for the reply, but I'll probably stick with the "for each" script I
already have to go thru all my items.

I know that the given example wasn't real VBA script, it was only
mentioned
to clear out the problem.

Could this be done be a simple search and find; perhaps some kind of
filter
or query!?


"Sue Mosher [MVP-Outlook]" <suemvp@xxxxxxxxxxxxxxx> wrote in message
news:ueXDWciGIHA.936@xxxxxxxxxxxxxxxxxxxxxxx
I always think it's a good idea to create the query string with a separate
statement, so you can test the result:

strFind = "[Flagstatus]=""&olNoFlag&"
MsgBox strFind

In this case, that would give you a query string of

[Flagstatus]="&olNoFlag&

which isn't going to find anything at all. First of all, FlagStatus is an
enumerated property, not a string. Second, the & characters are used in
your
expression as string literals not concatenation operator. So, you're
close,
but not quite there. This would be the query expression that includes the
actual value of olNoFlag:

strFind = "[Flagstatus]=" & olNoFlag

To use AdvancedFind in a script, you'd need a loop with a timer to add a
delay to allow the search to complete. I'd stick to Find and Restrict.

"PascalB" <pascal.bourgeoisSP@xxxxxxxxxxxxxx> wrote in message
news:enxfUMgGIHA.4196@xxxxxxxxxxxxxxxxxxxxxxx
Hi,

Looking thru the help file and MSDN, I wasn't able to find an example to
find messages by flagstatus.
The only examples I found are looping thru the entire folder.

I need to find only certain mailitems who are not flagged, or the
Flagicon
is Red.

For example, i need
Set myItem = myFolder.Items.Find("[Flagstatus]=""&olNoFlag&")

I know it is possible to search certain mailitems by using "Advanced
find",
but how do you do this by script?

Thanks in advance,

PascalB






.



Relevant Pages

  • Re: Find flagstatus
    ... Sue Mosher, Outlook MVP ... or query!? ... but I'll probably stick with the "for each" script I ... I always think it's a good idea to create the query string with a separate ...
    (microsoft.public.office.developer.outlook.vba)
  • Re: Find flagstatus
    ... or query!? ... Sue Mosher, Outlook MVP ... but I'll probably stick with the "for each" script I ... I always think it's a good idea to create the query string with a separate ...
    (microsoft.public.office.developer.outlook.vba)
  • Re: ADO and very large queries
    ... Since the script is quite large, and it works when using the Query ... The only general advise I can give - try to minimize you TSQL statement ... I don't think you would get the error you report if the query string were ...
    (microsoft.public.vb.database.ado)
  • Re: Find flagstatus
    ... I always think it's a good idea to create the query string with a separate statement, so you can test the result: ... To use AdvancedFind in a script, you'd need a loop with a timer to add a delay to allow the search to complete. ... Sue Mosher, Outlook MVP ... I need to find only certain mailitems who are not flagged, ...
    (microsoft.public.office.developer.outlook.vba)
  • Re: Find flagstatus
    ... but I'll probably stick with the "for each" script I ... I always think it's a good idea to create the query string with a separate ... Sue Mosher, Outlook MVP ... I need to find only certain mailitems who are not flagged, ...
    (microsoft.public.office.developer.outlook.vba)

Loading