+ Reply to Thread
Results 1 to 10 of 10

Search and Flag the Emails in Outlook based on the Data in Excel (Subject column)

  1. #1
    Forum Contributor
    Join Date
    06-04-2011
    Location
    Hyderabad
    MS-Off Ver
    Excel 2007
    Posts
    108

    Post Search and Flag the Emails in Outlook based on the Data in Excel (Subject column)

    Hi,

    Wanna to search the emails in outlook 2007 based upon the data in Excel. Daily I recevies N number of emails and I do export those mails into workbook.

    Now what happens is I may get duplicate mails. So, have to check/search/flag the emails in outlook based on Excel, in which it has the old data, columns as From, Subject, Date, etc.

    Please anyone's help will be appreciable that makes my work easier and useful with your code.

    Please find the below code which I have worked, badly not working..

    Please Login or Register  to view this content.
    Thanks & Regards
    Chaitanya A

  2. #2
    Forum Expert
    Join Date
    06-18-2004
    Location
    Canada
    MS-Off Ver
    Office 2016
    Posts
    1,474

    Re: Search and Flag the Emails in Outlook based on the Data in Excel (Subject column)

    Can you provide a sample of the data in Excel?

  3. #3
    Forum Contributor
    Join Date
    06-04-2011
    Location
    Hyderabad
    MS-Off Ver
    Excel 2007
    Posts
    108

    Re: Search and Flag the Emails in Outlook based on the Data in Excel (Subject column)

    Hi Domenic,


    Example.xlsx


    Please find the attached with example data, in which by using the subject coulmn I have to search/flag the emails in outlook..

    Eagerly waiting, Domenic...

  4. #4
    Forum Expert
    Join Date
    06-18-2004
    Location
    Canada
    MS-Off Ver
    Office 2016
    Posts
    1,474

    Re: Search and Flag the Emails in Outlook based on the Data in Excel (Subject column)

    Actually, now that I've given it some more thought, I think there may be a couple of problems with the way you're trying to do it. The first problem is that the dates contained in your workbook do not include the time. Whereas the code returns both the date and time (including seconds) from an email. As a result, we wouldn't be able to use date and time as a unique identifier. Then, if I'm not mistaken, the second problem is that even when two emails are duplicates, the time received can differ. See if the following helps...

    http://www.planet-source-code.com/vb...40372&lngWId=1

  5. #5
    Forum Contributor
    Join Date
    06-04-2011
    Location
    Hyderabad
    MS-Off Ver
    Excel 2007
    Posts
    108

    Re: Search and Flag the Emails in Outlook based on the Data in Excel (Subject column)

    Hi Domenic,

    Thanks for the code, but as per my view that I have to find the emails based upon the Excel data. There is no matter that the date is not a concern. Based on the Subject column in Excel, have to find/track the emails in outlook..


    Is there any posibility of the code? Please help me out in finding the solution to this problem..

    Hope, you will guide me and sure will wait for the reply..

  6. #6
    Forum Expert
    Join Date
    06-18-2004
    Location
    Canada
    MS-Off Ver
    Office 2016
    Posts
    1,474

    Re: Search and Flag the Emails in Outlook based on the Data in Excel (Subject column)

    Assumptions:

    1) The sheet containing the data is the active sheet.

    2) Column A contains "From", and Column B contains "Subject"


    Notes:

    1) For each name in Column A, the macro searches and flags all emails with the same name and corresponding subject.

    2) The search in matching both the name and subject is case-sensitive.

    3) A reference needs to be set by selecting 'Tools > References > Microsoft Outlook xx.x Object Library'.


    Code:

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    06-04-2011
    Location
    Hyderabad
    MS-Off Ver
    Excel 2007
    Posts
    108

    Re: Search and Flag the Emails in Outlook based on the Data in Excel (Subject column)

    Hi Domenic,

    Really I'm glad for you code, but here I'm getting an Error as

    Run-time error '-2147352567 (80020009)':

    Cannot parse condition. Error at ",".


    at line
    Set MItem = MItems.Find("[From] = " & strName)

    Could you please suggest me..

  8. #8
    Forum Expert
    Join Date
    06-18-2004
    Location
    Canada
    MS-Off Ver
    Office 2016
    Posts
    1,474

    Re: Search and Flag the Emails in Outlook based on the Data in Excel (Subject column)

    It works for me on Excel 2010. Try replacing...

    Please Login or Register  to view this content.
    with

    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    06-04-2011
    Location
    Hyderabad
    MS-Off Ver
    Excel 2007
    Posts
    108

    Re: Search and Flag the Emails in Outlook based on the Data in Excel (Subject column)

    Hi Domenic,

    Thanks for the code. It's working..!!!! great..

    Thanks,
    Chaitanya

  10. #10
    Forum Expert
    Join Date
    06-18-2004
    Location
    Canada
    MS-Off Ver
    Office 2016
    Posts
    1,474

    Re: Search and Flag the Emails in Outlook based on the Data in Excel (Subject column)

    You're very welcome! Thanks for the feedback!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1