+ Reply to Thread
Results 1 to 4 of 4

Return Function as a String to dictate filepath of email attachment

  1. #1
    Registered User
    Join Date
    02-26-2020
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    29

    Return Function as a String to dictate filepath of email attachment

    Hi All,

    Trying to send an email with an attachment from the My Documents folder. Due to my networked settings I need to be able to change the file path depending on the specific users device etc, all the file paths will be different for each user etc.

    So I have a function that successfully returns my file path in a message box. I need to get that function to return a string so I can use it in my email subroutine

    Please Login or Register  to view this content.
    The above returns the file path for My Documents in a message box

    Please Login or Register  to view this content.
    and the above is the code to generate my email with the attachment.

    I've tried fiddling around with the function so that it returns a string, not a msgbox but I cant seem to figure it out! Ive tried putting a new dimension and setting as the function return too with no luck!

    Any advice? Thanks in advance to all!

  2. #2
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,122

    Re: Return Function as a String to dictate filepath of email attachment

    Please Login or Register  to view this content.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  3. #3
    Registered User
    Join Date
    02-26-2020
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    29

    Re: Return Function as a String to dictate filepath of email attachment

    You guys are Genius!! Thank you so much!! It was stressing me out I couldn't get that! And you cleaned up the code for the email too... Tal.En.Ted.

    Thanks again.

  4. #4
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,122

    Re: Return Function as a String to dictate filepath of email attachment

    Pleasure...Tx for rep...
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED

+ 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. [SOLVED] Rule to file email in email folder, save the attachment to desk top and update spreadsheet
    By JET2011 in forum Outlook Formatting & Functions
    Replies: 49
    Last Post: 08-29-2018, 12:49 PM
  2. Code to disable print function and "email as attachment" function
    By kosherboy in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-31-2013, 01:59 PM
  3. How to create email, adn add hyperlink for workbook filepath?
    By Rerock in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-11-2012, 02:51 AM
  4. [SOLVED] Return FolderPath to add attachment to email
    By rtcwlomax in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-13-2012, 06:01 AM
  5. Attachment manipulation based on string in attachment
    By fterveen in forum Outlook Programming / VBA / Macros
    Replies: 1
    Last Post: 04-27-2012, 08:40 AM
  6. Monthly string in filepath
    By TonyforVBA in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-07-2010, 03:11 PM
  7. email excel file or worksheet as an attachment to multiple email addresses
    By jgeagle5 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-16-2009, 03:40 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