Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am using the following code to send an e-mail from a macro within Excel.
This works but the purpose of the e-mail it to indicate to the recipient a file which needs to be examined. I would like the filename to appear as a hyperlink so that when the e-mail is received the name can be clicked on to open the required file. Can anyone suggest a modification to the code which would write a hyperlink to the piece of text on the mail? Any help greatly appreciated. Public Sub eMailReiterReq() Dim strbody As String Dim OutApp As Object Dim OutMail As Object Dim strbody As String Set OutApp = CreateObject("Outlook.Application") OutApp.Session.Logon Set OutMail = OutApp.CreateItem(0) 'Messeage content for e-mail strbody = "Equipment has failed its check and requires attention." & vbNewLine & _ "Results Spreadsheet located at:-" & vbNewLine & _ "" & vbNewLine & _ "D:\myfilespathstructure\myimportantfilename.x ls '<<<<< This is required to be a hyperlink to go direct to the file. On Error Resume Next With OutMail .To = " .CC = "" .BCC = "" .Subject = strsub .Body = strbody .Display 'Application.Wait (Now + TimeValue("0:00:00")) '- Uncomment these lines to auto send after timer time out. 'Application.SendKeys "%S" End With On Error GoTo 0 Set OutMail = Nothing Set OutApp = Nothing End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
(repostX4) Adding hyperlink to macro-generated pivot tables | Excel Programming | |||
(repostX3) Adding hyperlink to macro-generated pivot table | Excel Programming | |||
Adding hyperlinks to macro-generated sheets from list of sheet nam | Excel Programming | |||
Formatting e-mail generated by Excel | Excel Programming | |||
Macro to e-mail hyperlink | Excel Programming |