MAinsworth
New Member
- Joined
- Sep 26, 2011
- Messages
- 2
I'm using vba code to send an email to users of a common spreadsheet. This spreadsheet contains lines of data. Is it possible to send a link in a html email to open the excel spreadsheet (Book1.xls) with a particular value in a cell. I've extracted the code below, the bit in red is where I need help.
Sub SendEmail()
Dim OutApp As Object
Dim OutMail As Object
Dim eMsg As String
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
eMsg = "<br>This is a test. <a href = C:\Book1.xls A1=22>Test</a>"
With OutMail
.BodyFormat = olFormatHTML
.To = "fred"
.Subject = "test"
.HTMLBody = eMsg
End With
OutMail.Display
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
Thanks,
Martin.
Sub SendEmail()
Dim OutApp As Object
Dim OutMail As Object
Dim eMsg As String
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
eMsg = "<br>This is a test. <a href = C:\Book1.xls A1=22>Test</a>"
With OutMail
.BodyFormat = olFormatHTML
.To = "fred"
.Subject = "test"
.HTMLBody = eMsg
End With
OutMail.Display
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
Thanks,
Martin.