-
Include network file path as a hyperlink in vba email
Hi
I use the following code to give users of a shared workbook the option to email a pre-defined list of people about an update. I'd like to be able to include a hyperlink to the file on our network server in the email where it says 'Please check here', but I'm not sure how. Does anyone have any suggestions?
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Save As Boolean)
Dim answer As String
answer = MsgBox("Do you want to notify the team?", vbYesNo, "Email team")
If answer = vbNo Then SaveUI = True
If answer = vbYes Then
'open outlook type stuff
Set OutlookApp = CreateObject("Outlook.Application")
Set OlObjects = OutlookApp.GetNamespace("MAPI")
Set newmsg = OutlookApp.CreateItem(olMailItem)
'add recipients
'newmsg.Recipients.Add ("Insert name")
newmsg.Recipients.Add ("Insert email address")
'add subject
newmsg.Subject = "Updated document"
'add body
newmsg.Body = "Updated document." & vbCrLf & "" & "Please check here"
newmsg.Display 'display
newmsg.Send 'send message
'give conformation of sent message
MsgBox "Outlook message sent", , "Outlook message sent"
End If
'save the document
'Me.Worksheets.Save
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules