CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Jan 2005
    Posts
    76

    FILTER outlook items

    I use this line to a AND new condition in a filter in e-mail subject but go in error!
    Peraph the LIKE clausloe not is accepted ????

    Set olItms = olFld.Items.Restrict("[SenderName]='gssitaly@iol.it' AND [Subject] Like '*:re*'")

    The error is "not valid condition"

  2. #2
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: FILTER outlook items

    FILTERS don't understand AND conditions for unrelated fields
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  3. #3
    Join Date
    Jan 2005
    Posts
    76

    Re: FILTER outlook items

    Quote Originally Posted by dglienna View Post
    FILTERS don't understand AND conditions for unrelated fields
    Ok... in effect the code work only with the first condition for Sendername.
    Admit i have set the eamil with the first condition i can use a next line similar:

    for x = ....
    Set olItms = instr(olFld.Items.Restrict("[subject], "test")
    nxt


    if my idea is correct how to set, during the loop, the newest email based the sender date?

  4. #4
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: FILTER outlook items

    Use SQL and SORT it
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  5. #5
    Join Date
    Jan 2005
    Posts
    76

    Re: FILTER outlook items

    Quote Originally Posted by dglienna View Post
    Use SQL and SORT it
    Tath is new for me...... SQL mwith Outlook object?
    Example please.:-)

  6. #6
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: FILTER outlook items

    Visual Studio TOOLS for OFFICE help with that
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured