LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Adding a hyperlink to a macro generated e-mail

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
(repostX4) Adding hyperlink to macro-generated pivot tables klysell Excel Programming 0 August 1st 07 06:26 PM
(repostX3) Adding hyperlink to macro-generated pivot table klysell Excel Programming 0 July 30th 07 06:30 PM
Adding hyperlinks to macro-generated sheets from list of sheet nam klysell Excel Programming 0 July 26th 07 08:04 PM
Formatting e-mail generated by Excel JBCIB[_9_] Excel Programming 4 May 4th 06 05:33 PM
Macro to e-mail hyperlink Ian[_8_] Excel Programming 0 July 30th 03 11:14 AM


All times are GMT +1. The time now is 03:09 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"