+ Reply to Thread
Results 1 to 6 of 6

Macro to save email attachments with date received in attachment name

  1. #1
    Registered User
    Join Date
    12-29-2014
    Location
    My cube
    MS-Off Ver
    2016
    Posts
    16

    Macro to save email attachments with date received in attachment name

    I am trying to create a macro that can save my email attachments with a link to the attachment in the original email. I would also like the attachments have the date received in the file name, and if there are two files received on the same day then any duplicates could have a (2) at the end of the file name (or 3, 4, etc.).

    Below is the code I am trying to work with

    Please Login or Register  to view this content.
    Thank you for your time.

  2. #2
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Macro to save email attachments with date received in attachment name

    Hi there,

    For duplicates received on the same day, would it be more helpful to include the time received (hh:mm) in the filename rather than (2), (3) etc.?

    Is it more useful to have the Date at the start of the filename or at the end of it? if you're going to have it at the start, the most useful data format is yyyy-mm-dd, as this format will be sorted chronologically by a file manager.

    Regards,

    Greg M
    Last edited by Greg M; 08-18-2015 at 03:49 PM. Reason: Question added

  3. #3
    Registered User
    Join Date
    12-29-2014
    Location
    My cube
    MS-Off Ver
    2016
    Posts
    16

    Re: Macro to save email attachments with date received in attachment name

    Thank you for that heads up - I modified the code below to show the date/time that the file was received. The only issue I'm having is that when I run this code below to remove the attachments after they are saved, it lists every attachment that was removed at the end of every email.

    Any input of this would be great.

    Please Login or Register  to view this content.

  4. #4
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Macro to save email attachments with date received in attachment name

    Hi again,

    Try the following code and see if it does what you need:

    Please Login or Register  to view this content.
    You can set the value of the highlighted constant to True if you want the time stamp to be added at the end of the filename of the attachment.

    Hope this helps - please let me know how you get on.

    Regards,

    Greg M

  5. #5
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Macro to save email attachments with date received in attachment name

    Hi again,

    Sorry - sent my last email before reading your last one.

    I'll take a look at it now.

    Regards,

    Greg M

  6. #6
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Macro to save email attachments with date received in attachment name

    Hi again,

    The attached code should delete the attachments without recording that fact in the body of the email:

    Please Login or Register  to view this content.
    Hope this helps - please let me know how you get on.

    Regards,

    Greg M

+ 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. Rule to save attachments to specific folders depending on attachment file name
    By ndrobinson in forum Outlook Formatting & Functions
    Replies: 0
    Last Post: 09-17-2013, 04:16 PM
  2. Replies: 0
    Last Post: 02-21-2013, 04:46 AM
  3. [SOLVED] Looping Email- Multiple Attachments but I Only Want Selected Attachment
    By cschoyer in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-02-2012, 09:16 AM
  4. Trying to save email by attachment name using VBA code
    By dwhite30518 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-22-2012, 04:29 PM
  5. save email attachments from incoming mail
    By mcinnes01 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-07-2011, 08:00 AM
  6. Outlook, print pdf Save Attachment, Move Email To A Subfolder
    By stephen1000 in forum Outlook Programming / VBA / Macros
    Replies: 7
    Last Post: 11-16-2009, 07:18 PM
  7. [SOLVED] Can I save multiple email attachments using excel automatically?
    By ir26121973 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 03-18-2006, 03:00 PM
  8. [SOLVED] Saving Received Excel Attachments
    By Lou in forum Excel General
    Replies: 5
    Last Post: 01-13-2005, 08:06 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