Add hyperlink to body of email thru Excel

  • Thread starter Thread starter MAYDAY
  • Start date Start date
M

MAYDAY

Hi,

I have a macro that saves an excel file and sends it to variou
recipients. How would I add a hyperlink to the body of the emai
instead of the actual file itself?


ActiveWorkbook.SendMail Recipients:=Array("Body, Ann E"), _
Subject:="Test Hyperlink"


Thanks in advance
 
Try something like:

With usrAPinvoices
If usrAPinvoices.optEmailRpts = True Then
Application.DisplayAlerts = False
'mailing routine
Workbooks(ExpFileName).Activate
mMsg = "This Invoice file created on " & Application.Text(Now(),
"dd mmm yyyy HH:mm") _
& ". http://xl.barasch.com"
If ActiveWorkbook.HasRoutingSlip = False Then
ActiveWorkbook.HasRoutingSlip = True
End If
With ActiveWorkbook.RoutingSlip
.Recipients = BranchAdmin
.Subject = Branch & " AP Invoices"
.Message = mMsg
.Delivery = xlAllAtOnce
.ReturnWhenDone = False
.TrackStatus = True
End With
Application.DisplayAlerts = True
Else
'don't mail
End If
End With
 
Hello

I hope this help you


Sub CreationMailEtLienHypertexte()
Dim OlApp As New Outlook.Application
Dim OlItem As Outlook.MailItem

Set OlItem = OlApp.CreateItem(olMailItem)

With OlItem
..To = "(e-mail address removed)"
..Subject = "Le titre du message"
..HTMLBody = "<BODY><A href='" & ThisWorkbook.FullName & _
"'>The WorkBook</A></BODY>" 'adapt the link
..Display
..Save
..send
End With

Set OlItem = Nothing
Set OlApp = Nothing
End Sub



Regards ,
michel
 
Back
Top