• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

MS Outlook - find subject line by VBA (in excel)

Akshay Divecha

New Member
Hi Experts,

I need help regarding Outlook VBA.

I have subject lines mentioned in an excel file, for example Range A3, A4,A5,A6

I need to check in Outlook 2016, Inbox if mail with subject line mentioned in
Column A is received or not.

If received, then details such as senders address, subject line, received date to be copied in column B, C & D

Also the hyperlink of the email to be created on column E

Can anyone please share the codes

Thanks in advance...
 

Attachments

  • Mail finder.xlsx
    8.9 KB · Views: 5
Hi,
Hope this helps.
No need to open outlook but when outlook is open the code is faster.
See attached
Mails received less or equal to 6 days will appear in the results, change to your needs.
 

Attachments

  • Mail finder.xlsb
    32.1 KB · Views: 8
Hi Belleke,

Thanks for your work, got the error msg as attached.

any possibility to find the emails within a range of 1 month.

Also if i can add subject directly in column B instead of adding it from "Add Subject"

Also if subjects are deleted from column B, it does not gets deleted from "Find" button.

Please help !

Once again thanks.
 

Attachments

  • 2018-03-09 09_09_37-Mail finde.png
    2018-03-09 09_09_37-Mail finde.png
    20 KB · Views: 5
  • 2018-03-09 09_09_54-Microsoft Visual Basic for Ap.png
    2018-03-09 09_09_54-Microsoft Visual Basic for Ap.png
    34.4 KB · Views: 5
  • 2018-03-09 09_12_16-Mail finder  [Read-Only] - Excel.png
    2018-03-09 09_12_16-Mail finder [Read-Only] - Excel.png
    16.7 KB · Views: 4
  • 2018-03-09 09_16_02-Mail finder.png
    2018-03-09 09_16_02-Mail finder.png
    17.7 KB · Views: 4
See attached (2)
The first example
Add or delete subjects in column B, push the renew button to reload the combobox
The second example, click a subject in Column B and push the search button
IMPORTANT!! I forgot to mention yesterday.:oops:
In the VBA editor you have to check Microsoft Outlook 16.0 Object Library
in Extra -> References
 

Attachments

  • Mail finder (v3).xlsb
    23.6 KB · Views: 4
  • Mail finder (v2).xlsb
    28.1 KB · Views: 5
Thanks once again Belleke,

But there are some errors which need your help to fix.

Seems all mails are fetched instead of desired mail.

Hyper link is also not working.
 

Attachments

  • 2018-03-09 19_12_09-Microsoft Visual Basic for Applications - Mail finder.png
    2018-03-09 19_12_09-Microsoft Visual Basic for Applications - Mail finder.png
    45.4 KB · Views: 10
  • 2018-03-09 19_13_03-Mail finder (v3) - Excel.png
    2018-03-09 19_13_03-Mail finder (v3) - Excel.png
    67.8 KB · Views: 7
Back
Top