Re: Find flagstatus

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



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!?

Cheers,
PascalB
-----------------



"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.

--
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: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
    ... 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: dynamically embedding objects in html
    ... I am looking forward to your script. ... flash movie I need to play is test.swf. ... sample code which decodes my query string and embeds the swf file I ...
    (alt.html)
  • Re: Find flagstatus
    ... I wouldn't ask you this if the folder where I should find these mailitems ... 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: Logic behind this?
    ... Without the query string the inclusion works fine. ... division of scope within the included PHP script. ... Including either local or remote PHP script files with a HTTP request looks ...
    (comp.lang.php)