troubleshooting Question

Include a hyperlink in the body of an email

Avatar of grayco
graycoFlag for United States of America asked on
Microsoft ExcelMicrosoft Office
4 Comments1 Solution87 ViewsLast Modified:
Greetings Experts,
I have a maintenance file that includes a "save" button that saves the file and sends two people emails telling them that the file has had an addition.  I have the network address included in the body of the email, but I would like to just click on the address and be able to access the file from the email.  Here is the macro I currently have;

Sub Mail_small_Text_Outlook()
    Dim OutApp As Object
    Dim OutMail As Object
    Dim strbody As String
    Set OutApp = CreateObject("Outlook.Application")
    Set OutMail = OutApp.CreateItem(0)

    strbody = "A new maintenance item has been added to the Maintenance Log. You can view this file at Y:\Common\Facilities Maintenance\Fac Maint Log.xlsm "
*** this is the line that I would like to fix so the file location is a link***

    On Error Resume Next
    With OutMail
        .To = "Rob Cummings <>; Glen Ray <>"
        .CC = ""
        .BCC = ""
        .Subject = "A maintenance item has been added to the Maint Log"
        .Body = strbody
    On Error GoTo 0

    Set OutMail = Nothing
    Set OutApp = Nothing
    End With
    Application.CommandBars("Worksheet Menu Bar").Controls("File").Controls("Save As...").Enabled = False
    Application.CommandBars("Worksheet Menu Bar").Controls("File").Controls("Save").Enabled = False

End Sub
Wayne Taylor (webtubbs)

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros