Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 12
Default 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   Report Post  
Posted to microsoft.public.excel.misc
KC KC is offline
external usenet poster
 
Posts: 94
Default 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
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
message in the body of the email pdaws Excel Worksheet Functions 1 September 30th 08 04:11 PM
Excel 2003 body of email trish r. Excel Discussion (Misc queries) 2 February 14th 07 04:05 PM
Add info into main body of email Noemi Excel Discussion (Misc queries) 0 May 10th 06 01:04 AM
Add comments into email body using VBA Noemi Excel Discussion (Misc queries) 5 January 23rd 06 04:54 AM
body of email disappears when I send an email from Excel ~A Excel Discussion (Misc queries) 0 February 25th 05 10:55 PM


All times are GMT +1. The time now is 09:43 PM.

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

About Us

"It's about Microsoft Excel"