+ Reply to Thread
Results 1 to 7 of 7

Modifying File name structure to accommodate multiple attachments on the same email

  1. #1
    Forum Contributor
    Join Date
    05-13-2012
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2010
    Posts
    378

    Question Modifying File name structure to accommodate multiple attachments on the same email

    I am using the following code to save attachments based using subject line as the file name...

    Please Login or Register  to view this content.
    The code work great but I do not know what to do if there are multiple attachments on the email. So how do I modify this code so that the file name includes something like Pic 1, Pic 2 are so on based on the qty of attachments on that email and if only one attachment then it does not add anything else to the file name that is already coded in this code?

    Thanks!!!!!!

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Modifying File name structure to accommodate multiple attachments on the same email

    Why not just use i?
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    05-13-2012
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2010
    Posts
    378

    Re: Modifying File name structure to accommodate multiple attachments on the same email

    This work well but for some reason after the first item, it does not include the "sName" portion of the naming structure for the other attachments.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Modifying File name structure to accommodate multiple attachments on the same email

    I can't see why that would happen, the only thing I added was this.
    Please Login or Register  to view this content.
    By the way, why aren't you using the attachment names?

  5. #5
    Forum Contributor
    Join Date
    05-13-2012
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2010
    Posts
    378

    Re: Modifying File name structure to accommodate multiple attachments on the same email

    Because these are generic numbers that are created when individuals take the pictures and email them from their phone. The Subject line has the details I need but for some reason, after the first attachment, is stops adding the subject name to the naming structure...it was doing that even before I added your modification, so not related to your mods.

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Modifying File name structure to accommodate multiple attachments on the same email

    What happens if you move this outside the loop that's going through the attachments?
    Please Login or Register  to view this content.
    Or if instead of using that you use this.
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    05-13-2012
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2010
    Posts
    378

    Re: Modifying File name structure to accommodate multiple attachments on the same email

    I used...
    Please Login or Register  to view this content.
    and got the result I am looking for.

    Thanks!!!!

+ 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. Adding multiple variable PDF attachments to an email
    By Danix in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-09-2015, 09:04 AM
  2. Add multiple attachments to email
    By Groovicles in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 03-27-2015, 05:34 PM
  3. [SOLVED] Email Multiple Attachments From Specified Path
    By hamidxa in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-05-2015, 01:23 PM
  4. copy data from outlook email attachments to a local file
    By s_samira_21 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-19-2014, 10:24 AM
  5. Replies: 0
    Last Post: 02-21-2013, 04:46 AM
  6. Email with multiple attachments
    By mcinnes01 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-12-2011, 09:33 AM
  7. Replies: 4
    Last Post: 02-11-2005, 03: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