Hyperlink test to display

josros60

Well-known Member
Joined
Jun 27, 2010
Messages
779
Office Version
  1. 365
Hi,

how can I modify the code below to change the display "Link to file" to \\mtlnas01\EFT_backup\2021\11 November 2021\ 939 1-6 NCL USD Wires Summary January 00, 1900.xlsx (to display where saved) people don't know that pointing the mouse will display the full path, much appreciated.

code:


VBA Code:
Sub Make_Outlook_Mail_With_File_Link()
'Working in Excel 2000-2016
    Dim OutApp As Object
    Dim OutMail As Object
    Dim strbody As String

    If ActiveWorkbook.Path <> "" Then
        Set OutApp = CreateObject("Outlook.Application")
        Set OutMail = OutApp.CreateItem(0)

        strbody = "<font size=""3"" face=""Calibri"">" & _
                  "Hi Lawrie,<br><br>" & _
                  "<br><B>" & _
                 ActiveWorkbook.Name & "</B> is created.<br>" & _
                  "Please click on this link to open the file : " & _
                  "<A HREF=""file://" & ActiveWorkbook.FullName & _
                  """>[B][COLOR=rgb(209, 72, 65)]Link to the file[/COLOR][/B]</A>" & "</B> <br> <br>" & _
                  "NCL USD WIRES SUMMARY.PDF" & "</B> is saved.<br>" & _
                  "Please click on this link to open the backup : " & _
                  "<A HREF=""file://" & NetworkPath & ActiveWorkbook.ActiveSheet.Range("F3") & _
                  """>[B][COLOR=rgb(226, 80, 65)]Link to the file[/COLOR][/B]</A>" & _
                  "<br><br>Note: The WIRES backup link is in the spreadsheet as well...." & _
                  "<br><br>Thank you," & _
                  "<br><br></font>"

        On Error Resume Next
        With OutMail
            .To = "lawrie.coutinho@distributel.ca"
            .CC = ""
            .BCC = ""
            .Subject = "" & Range("SUBJECT").Value 'ActiveWorkbook.Name
            .Attachments.Add Application.ActiveWorkbook.FullName
            .HTMLBody = strbody
            .Display   'or use .Send
        End With
        On Error GoTo 0

        Set OutMail = Nothing
        Set OutApp = Nothing
    Else
        MsgBox "The ActiveWorkbook does not have a path, Save the file first."
    End If
End Sub

Thank you
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

Forum statistics

Threads
1,214,567
Messages
6,120,268
Members
448,953
Latest member
Dutchie_1

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top