How to display search results?

  • Thread starter Thread starter Macko
  • Start date Start date
M

Macko

1. I want to search specified emails with my conditions inside INBOX an
than DISPLAY the results in INBOX. It should work just like clicking o
the Find button in outlook toolbar. Only emails which fit quer
conditions are displayed.
2. I don't know how to filter emails in INBOX by sender e-mail

I want to write the code in VBA however without using AdvancedSearc
which is specified only for Outlook 2002. I know about Restrict an
Find methods, but i don't know how to access sender email with thes
methods. MailItem doesn't have [Sender email] or something like thi
property. There is only his displayed name. I think the only way t
solve my problem is to iterate through all emails and chec
MailItem.Reply object to acces sender email.

Thanks for any suggestions,

Macie
 
The ReplyTo address would only give you want you want if the sender
hasn't specified a different ReplyTo address when the item was sent.
It's not 100% reliable. To get the actual sender's email address you
would need to use CDO 1.21 (optional installation for Outlook 2000 and
later), Extended MAPI (C++ or Delphi only and a long learning curve)
or Redemption (www.dimastr.com/redemption). Secure versions of Outlook
would fire the security prompts when trying to get the sender's email
address if you used CDO 1.21 code however.

For a CDO example see
http://www.slovaktech.com/code_samples.htm#FromAddress
 
Thanks, indeed ReplyTo could be quite problematic, but at this time
see no other choice. Maybe later I'll use Outlook Redemption.

However still I don't know how to display search results which i
specified in my first question. I can set filtered items object, bu
how to display them in INBOX??? The idea Im trying to do is to filte
messages in INBOX to see only those which are important at thi
momnet.

Thanks,

Macie
 
Thanks, indeed ReplyTo could be quite problematic, but at this time
see no other choice. Maybe later I'll use Outlook Redemption.

However still I don't know how to display search results which i
specified in my first question. I can set filtered items object, bu
how to display them in INBOX??? The idea Im trying to do is to filte
messages in INBOX to see only those which are important at thi
momnet.

Thanks,

Macie
 
Please post parts of the preceding thread in your messages. That
horrid ExcelTips interface you are using doesn't do that and it makes
it very hard to follow a thread and to provide answers to questions.

You don't say what version of Outlook you are targeting. User created
filtered views can only be done in Outlook 2002 or later and have
severe limitations in what and how they can filter the view. The views
are created using XML. There is information about it in the MSDN
library and in the KB.

Restrictions and Filters on Items collections are for code only. There
is no way to get that filtered Items collection into the UI. You are
going to find severe limitations in any code solution you try.
 
Back
Top