Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 273
Default Sending Email via VBA

I'm sending an email using VBA via the code listed below. Everything works
fine, but I'd like to incorporate a hyperlink in the body of the email, which
I don't know how to do. Right now the link (text) is in the body of the
email, but i do not know how to make it a hyperlink. Any help is appreciated.

'here's my example
Dim OutApp As Outlook.Application
Dim OutMail As Outlook.MailItem
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
Dim strbody As String

strbody = "Please visit us at www.test.com. Thank you." 'i want the
www.test.com to be a clickable hyperlink

With OutMail
.To = "
.Subject = "test email"
.Body = strbody
.Display 'or use '.Send
End With

Thanks in advance,
Chad
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Sending Email via VBA

Use .HTMLBody

There is a example here
http://www.rondebruin.nl/mail/tips2.htm



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Chad" wrote in message ...
I'm sending an email using VBA via the code listed below. Everything works
fine, but I'd like to incorporate a hyperlink in the body of the email, which
I don't know how to do. Right now the link (text) is in the body of the
email, but i do not know how to make it a hyperlink. Any help is appreciated.

'here's my example
Dim OutApp As Outlook.Application
Dim OutMail As Outlook.MailItem
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
Dim strbody As String

strbody = "Please visit us at www.test.com. Thank you." 'i want the
www.test.com to be a clickable hyperlink

With OutMail
.To = "
.Subject = "test email"
.Body = strbody
.Display 'or use '.Send
End With

Thanks in advance,
Chad

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 273
Default Sending Email via VBA

Perfect, thanks!


"Ron de Bruin" wrote:

Use .HTMLBody

There is a example here
http://www.rondebruin.nl/mail/tips2.htm



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Chad" wrote in message ...
I'm sending an email using VBA via the code listed below. Everything works
fine, but I'd like to incorporate a hyperlink in the body of the email, which
I don't know how to do. Right now the link (text) is in the body of the
email, but i do not know how to make it a hyperlink. Any help is appreciated.

'here's my example
Dim OutApp As Outlook.Application
Dim OutMail As Outlook.MailItem
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
Dim strbody As String

strbody = "Please visit us at www.test.com. Thank you." 'i want the
www.test.com to be a clickable hyperlink

With OutMail
.To = "
.Subject = "test email"
.Body = strbody
.Display 'or use '.Send
End With

Thanks in advance,
Chad


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
Sending a Spreadsheet as an Email Attachment vs. Imbedded in Email billbrandi Excel Discussion (Misc queries) 1 April 3rd 08 03:44 AM
email sending Edwin Martinez Excel Programming 2 May 20th 07 11:46 AM
Sending Email katmando[_5_] Excel Programming 7 March 6th 06 05:20 PM
Email sending colourp Excel Discussion (Misc queries) 1 January 13th 06 01:13 AM
Sending an email Jamie Excel Programming 2 October 14th 04 02:51 PM


All times are GMT +1. The time now is 02:35 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"