+ Reply to Thread
Results 1 to 11 of 11

Making a filepath a hyperlink in an email generated with code

  1. #1
    Forum Contributor
    Join Date
    03-10-2014
    Location
    Sheffield
    MS-Off Ver
    Excel 2010
    Posts
    180

    Making a filepath a hyperlink in an email generated with code

    Hi,

    I have the following code to do something similar to above but I need to add the filepath as a hyperlink to the email along with the body text. I have 4 cells in the Excel workbook that contain 1) Who to sen to:, 2)The Subject:, 3) A sentence for the Body of the email and 4) The filepath of the workbook as a hyperlink.

    I want to add both the Body text and the hyperlink to the email so that the person opening the email can click on the link and open the file.

    Any help would be greatly appreciated!

    Thanks

    Please Login or Register  to view this content.
    Last edited by MissDB; 03-14-2014 at 08:13 AM. Reason: Didn't realise rules around posting code

  2. #2
    Valued Forum Contributor adyteo's Avatar
    Join Date
    01-10-2013
    Location
    Calgary
    MS-Off Ver
    Excel 2010
    Posts
    540

    Re: Making a filepath a hyperlink in an email generated with code

    try to add this:
    ActiveSheet.Hyperlinks.Add Anchor:=Range("AY5"), Address:="http://www.microsoft.com", TextToDisplay:=.Range("AY5")
    Click on the star if you think I helped you

  3. #3
    Forum Contributor
    Join Date
    03-10-2014
    Location
    Sheffield
    MS-Off Ver
    Excel 2010
    Posts
    180

    Re: Making a filepath a hyperlink in an email generated with code

    Hi,

    Thank you so much for replying. The link I need is not a website but a filepath of a file saved on a Share Drive. How would I adapt your code for this? Also where in the code would I place this?

    Quote Originally Posted by adyteo View Post
    try to add this:
    ActiveSheet.Hyperlinks.Add Anchor:=Range("AY5"), Address:="http://www.microsoft.com", TextToDisplay:=.Range("AY5")

  4. #4
    Valued Forum Contributor adyteo's Avatar
    Join Date
    01-10-2013
    Location
    Calgary
    MS-Off Ver
    Excel 2010
    Posts
    540

    Re: Making a filepath a hyperlink in an email generated with code

    Add it after With ActiveSheet
    change http... to "D:\Documents and Settings\xxx\My Documents\Personal\yyy.pptx" or wherever your file is located

  5. #5
    Forum Contributor
    Join Date
    03-10-2014
    Location
    Sheffield
    MS-Off Ver
    Excel 2010
    Posts
    180

    Re: Making a filepath a hyperlink in an email generated with code

    Hi,

    I know have this but it is not working:-

    Please Login or Register  to view this content.



    Quote Originally Posted by adyteo View Post
    Add it after With ActiveSheet
    change http... to "D:\Documents and Settings\xxx\My Documents\Personal\yyy.pptx" or wherever your file is located

  6. #6
    Valued Forum Contributor adyteo's Avatar
    Join Date
    01-10-2013
    Location
    Calgary
    MS-Off Ver
    Excel 2010
    Posts
    540

    Re: Making a filepath a hyperlink in an email generated with code

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    03-10-2014
    Location
    Sheffield
    MS-Off Ver
    Excel 2010
    Posts
    180

    Re: Making a filepath a hyperlink in an email generated with code

    This gives an invalid procedure call or argument Run Time Error

  8. #8
    Forum Contributor
    Join Date
    03-10-2014
    Location
    Sheffield
    MS-Off Ver
    Excel 2010
    Posts
    180

    Re: Making a filepath a hyperlink in an email generated with code

    The file path is in AY6 but I am not sure how to write it. When the person using the workbook saves it I need cell AY6 to update with the new file location. I then need this to be added to the email as a clickable link. The Body of the email is a sentence that is in cell AY5. I just need to add the file path in AY6 as a hyperlink under this sentence with the hyperlink.

  9. #9
    Valued Forum Contributor adyteo's Avatar
    Join Date
    01-10-2013
    Location
    Calgary
    MS-Off Ver
    Excel 2010
    Posts
    540

    Re: Making a filepath a hyperlink in an email generated with code

    Please Login or Register  to view this content.

  10. #10
    Valued Forum Contributor adyteo's Avatar
    Join Date
    01-10-2013
    Location
    Calgary
    MS-Off Ver
    Excel 2010
    Posts
    540

    Re: Making a filepath a hyperlink in an email generated with code

    if it does not work in excel then you would need to access Outlook methods from excel to insert the hyperlink in Outlook.

  11. #11
    Forum Contributor
    Join Date
    03-10-2014
    Location
    Sheffield
    MS-Off Ver
    Excel 2010
    Posts
    180

    Re: Making a filepath a hyperlink in an email generated with code

    I think I may have to leave it there then. My knowledge/skill level doesn't extend to what I need to do I don't think. Am a real beginner with all this. Thanks anyway.

+ 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] Change Font Size/Color on one line of an email automatically generated by a code.
    By coxb in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-18-2012, 01:55 PM
  2. 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
  3. Adding A Hyperlink To Excel Generated Email
    By WJO in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 03-13-2012, 04:29 PM
  4. Code to scrape system generated outlook email doesn't get all the data
    By bobaftt in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-15-2010, 01:57 PM
  5. embedding user-defined hyperlink into auto-generated email
    By kuraitori in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-17-2008, 10:49 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