Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Hyperlink in body of VBA email
Hi Guys,
I'm fairly new to VBA so this should be an easy fix. I am trying to include a network link in the body of an email that is being generated in VBA. I specifically want to make \\server\file a direct link or hyperlink to a specific network location. I can't seem to figure out how to do it. Thanks for your help. Below is the code: Sub EmailEE() ' 'Working in Office 2000-2007 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) strbody = "body of email" & vbNewLine & vbNewLine & _ "\\server\folder" & vbNewLine & vbNewLine & _ "Thank You," & vbNewLine & _ "Me" On Error Resume Next With OutMail ..To = " ..CC = " ..BCC = "" ..Subject = "whatever" ..Body = strbody ..Display End With On Error GoTo 0 Set OutMail = Nothing Set OutApp = Nothing End Sub |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Hyperlink in body of VBA email
use
OutMail.htmlbody = strbody instead of OutMail.Body=strbody and include hyperlink in strbody strbody= "body of email" & vbNewLine & vbNewLine & "<a href=""\\server\folder""\\server\folder</a" & vbNewLine & vbNewLine & "Thank You," & vbNewLine & "Me" -kc *Click YES if this helps "Chadersmith" wrote: Hi Guys, I'm fairly new to VBA so this should be an easy fix. I am trying to include a network link in the body of an email that is being generated in VBA. I specifically want to make \\server\file a direct link or hyperlink to a specific network location. I can't seem to figure out how to do it. Thanks for your help. Below is the code: Sub EmailEE() ' 'Working in Office 2000-2007 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) strbody = "body of email" & vbNewLine & vbNewLine & _ "\\server\folder" & vbNewLine & vbNewLine & _ "Thank You," & vbNewLine & _ "Me" On Error Resume Next With OutMail .To = " .CC = " .BCC = "" .Subject = "whatever" .Body = strbody .Display End With On Error GoTo 0 Set OutMail = Nothing Set OutApp = Nothing End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
message in the body of the email | Excel Worksheet Functions | |||
Excel 2003 body of email | Excel Discussion (Misc queries) | |||
Add info into main body of email | Excel Discussion (Misc queries) | |||
Add comments into email body using VBA | Excel Discussion (Misc queries) | |||
body of email disappears when I send an email from Excel | Excel Discussion (Misc queries) |