Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / August 2007

Tip: Looking for answers? Try searching our database.

Sending Email via VBA

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Chad - 31 Aug 2007 21:20 GMT
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 = "test@test.com"
           .Subject = "test email"
           .Body = strbody
           .Display   'or use '.Send
End With

Thanks in advance,
Chad
Ron de Bruin - 31 Aug 2007 21:26 GMT
Use .HTMLBody

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

Signature

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

> 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
[quoted text clipped - 20 lines]
> Thanks in advance,
> Chad
Chad - 31 Aug 2007 21:46 GMT
Perfect, thanks!

> Use .HTMLBody
>
[quoted text clipped - 25 lines]
> > Thanks in advance,
> > Chad
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.