PC Review


Reply
Thread Tools Rate Thread

Adding a hyperlink to a macro generated e-mail

 
 
=?Utf-8?B?R0RDb2JyYQ==?=
Guest
Posts: n/a
 
      17th Aug 2007
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.xls '<<<<<
This is required to be a hyperlink to go direct to the file.


On Error Resume Next
With OutMail
.To = "(E-Mail Removed)"
.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


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Adding CustomUI Ribbon code using macro to new generated file GS Microsoft Excel Programming 0 8th Aug 2011 03:42 PM
Re: Adding CustomUI Ribbon code using macro to new generated file Jim Rech Microsoft Excel Programming 0 8th Aug 2011 02:25 PM
(repostX4) Adding hyperlink to macro-generated pivot tables =?Utf-8?B?a2x5c2VsbA==?= Microsoft Excel Programming 0 1st Aug 2007 06:26 PM
(repostX3) Adding hyperlink to macro-generated pivot table =?Utf-8?B?a2x5c2VsbA==?= Microsoft Excel Programming 0 30th Jul 2007 06:30 PM
Adding hyperlinks to macro-generated sheets from list of sheet nam =?Utf-8?B?a2x5c2VsbA==?= Microsoft Excel Programming 0 26th Jul 2007 08:04 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:29 AM.