Ik wil graag een bestands locatie via e-mail verzenden met een knop in excel. Ik heb onderstaande code gevonden, deze werkt echter niet, onderstaande gedeelte wordt geel:
xStrBody = "Hi there:" & "<br>" _
& "Please click " & "<a href="/"C:/Voorbeeld map/Test.xls"">Here</a> to open the page" & "<br>" _
& "Thank you."
xStrBody = "Hi there:" & "<br>" _
& "Please click " & "<a href="/"C:/Voorbeeld map/Test.xls"">Here</a> to open the page" & "<br>" _
& "Thank you."
Code:
Sub EmailHyperlink()
'updated by Extendoffice 20190815
Dim xOtl As Object
Dim xOtlMail As Object
Dim xStrBody As String
xStrBody = "Hi there:" & "<br>" _
& "Please click " & "<a href="/"C:/Voorbeeld map/Test.xls"">Here</a> to open the page" & "<br>" _
& "Thank you."
On Error Resume Next
Set xOtl = CreateObject("Outlook.Application")
Set xOtlMail = xOtl.CreateItem(olMailItem)
With xOtlMail
.To = "Email Address"
.CC = "Email Address "
.BCC = " Email Address "
.Subject = "Subject line"
.HTMLBody = .HTMLBody & xStrBody
.Display
End With
Set xOtl = Nothing
Set xOtlMail = Nothing
End Sub
Laatst bewerkt: