+ Reply to Thread
Results 1 to 5 of 5

VBA code that searches all emails sent on Outlook based on specified information given

  1. #1
    Registered User
    Join Date
    08-07-2013
    Location
    Saudi Arabia
    MS-Off Ver
    Excel 2007 - 2010
    Posts
    73

    Smile VBA code that searches all emails sent on Outlook based on specified information given

    VBA code that searches all emails sent on Outlook based on specified information given

    Hi everyone,

    I hope you are doing great and keeping safe. I need your help to create the following VBA script that searches for all emails that contain the following:
    • Sent from a specific date onwards
    • Subject: * OQ#123456 * <-- always six (6) digits, can have more information before and after and possible spaces in between
    • Has an attachment
    • The BCC line has emails on it.

    With the emails found, we need to create an Excel file with the following:

    Column A - OQ#'s Column B - Emails
    OQ#12345 email1, email2, email3, email4
    OQ#12345 email1, email2, email3, email4

    The emails in the table are only those used in the BCC line.

    Can you please help????

  2. #2
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: VBA code that searches all emails sent on Outlook based on specified information given

    that's a lot of work, and there probably isn't an exact example on the web anywhere. however, you need to start here:

    - check the sentOn property: https://docs.microsoft.com/en-us/off...ailitem.senton

    - check the subject using the instr() function and other string functions. see these:

    https://docs.microsoft.com/en-us/off...ilitem.subject

    https://docs.microsoft.com/en-us/dot...ring-functions

    - check the attachments property for a count > 0: https://docs.microsoft.com/en-us/off...em.attachments

    - check the BCC property for a value of one greater than a zero-length string: https://docs.microsoft.com/en-us/off...k.mailitem.bcc

    to see how to loop a folder in outlook from excel, more or less copy what this person did in post #1:

    https://www.excelforum.com/excel-pro...ng-format.html

    more info here:
    https://docs.microsoft.com/en-us/off...tlook.mailitem

  3. #3
    Registered User
    Join Date
    08-07-2013
    Location
    Saudi Arabia
    MS-Off Ver
    Excel 2007 - 2010
    Posts
    73

    Re: VBA code that searches all emails sent on Outlook based on specified information given

    Thank you Adam - will check it out.

  4. #4
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: VBA code that searches all emails sent on Outlook based on specified information given

    post back here if you need help.

  5. #5
    Registered User
    Join Date
    10-06-2020
    Location
    Cologne, Germany
    MS-Off Ver
    Microsoft Office 2020
    Posts
    16

    Re: VBA code that searches all emails sent on Outlook based on specified information given

    Thanks for your advice. I was looking for this.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Writing VBA Code to Send Emails At a Specific Day From Outlook
    By EdwardSnowden in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-23-2019, 08:14 PM
  2. Replies: 0
    Last Post: 04-24-2015, 09:44 AM
  3. [SOLVED] help editing my code that emails a range of data via outlook.
    By Dremzy in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-27-2014, 12:24 PM
  4. Macro to generate Outlook emails with data/information from multiple rows of data
    By dasbrutalz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-30-2014, 07:34 PM
  5. VBA code to send automatic emails via outlook based on deadline
    By Britny in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-05-2013, 10:08 AM
  6. Post not responded too please help macro vba code for outlook emails
    By excelnoob1212 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-03-2012, 11:31 AM
  7. Export outlook emails - Security information
    By joe_for_good in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-22-2011, 05:24 PM

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