How can I attach a hyperlink to email

Gezza

Registered User.
Local time
Today, 21:01
Joined
Jun 19, 2009
Messages
53
Hi,

Is there a way of attaching a hyperlink to the body of an Outlook email using vba code?

I have already created code for creating and sending email and have worked out how to add attachments but how to add a hyperlink eludes me

Hope someone can help

Gezza
 
Gezza,
use the .HTMLBody property of the Outlook.MailItem Method.

This is a sample of an email i send each night that includes a link to a spreadsheet that contains details of work done. The string for you body text must use HTML tags, so <HTML> and <BODY> at the start and </BODY></HTML> at the end. For paragraphs use <p> and </p>. The hyperlink part is achieved with <a href>=

.HTMLBody = "<HTML><BODY><p>Brian,</p> <p>Details of work <a href=""W:\Swindon(Honda)\Night HTE ops.xls"">done</a> tonight.</p> <p>Regards,</p> <p>Mark</p> </BODY></HTML>"
 
Hi Isskint,

Thanks for you help :), That's the solution I was looking for

Cheers
Gezza
 

Users who are viewing this thread

Back
Top Bottom