Adding an Excel  Hyperlink in Outlook with an Excel Macro

Posted on 2011-02-24
Last Modified: 2012-05-11
Hi Guys, I am sending a Excel piece of work to my manager which he must approve via e-mail.
He wants a hyperlink to the Excel path in his e-mail so he can see it straight away. I have this code which sends him the e-mail from an Excel button with Voting Buttons but only text appears not a Hyperlink. Any ideas how its done?  
  With OutMail
            .To = ";"
            .VotingOptions = "Approve;Reject"    'you can include what you want in fact

            .CC = ""
            .BCC = ""
            .Subject = "FITR Dailies - "
            .Application.ActiveInspector.CurrentItem.HTMLBody = "G:\Restricted\UKMFG-TS-AM-EUC03\TRES\FITR - P11 Feb'11\FITR Oracle Dailies Feb'11.xlsm"

        End With
'        On Error GoTo 0
Question by:JCutcliffe
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 76

Accepted Solution

David Lee earned 500 total points
ID: 34972082
Hi, Justin.

You have to format the link as a hyperlink using HTML tags.  Change this line

.Application.ActiveInspector.CurrentItem.HTMLBody = "G:\Restricted\UKMFG-TS-AM-EUC03\TRES\FITR - P11 Feb'11\FITR Oracle Dailies Feb'11.xlsm"


.Application.ActiveInspector.CurrentItem.HTMLBody = "<a href=""file://G:\Restricted\UKMFG-TS-AM-EUC03\TRES\FITR - P11 Feb'11\FITR Oracle Dailies Feb'11.xlsm"">Open the spreadsheet</a>"

Author Comment

ID: 34997963
Hi I am getting "Run time error '438' Object does not support this property or method" using your code (see below). Any ideas why?

    .To = ";"
            .VotingOptions = "Approve;Reject"  
                   .Subject = "FITR Dailies - "
            .Body = "G:\Restricted\UKMFG-TS-AM-EUC03\TRES\FITR - P11 Feb'11\FITR Oracle Dailies Feb'11"
          Application.ActiveInspector.CurrentItem.HTMLBody = "<a href=""file://G:\Restricted\UKMFG-TS-AM-EUC03\TRES\FITR - P11 Feb'11\FITR Oracle Dailies Feb'11.xlsm"">Open the spreadsheet</a>"
LVL 76

Expert Comment

by:David Lee
ID: 35002440
Which line is the error on?

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
Are you unable to connect or configure Hotmail email account in Microsoft Outlook 2010, 2007? Or emails are not downloading to Outlook? Lets’ see the problem and resolve Outlook Connector error syncing folder hierarchy (0x8004102A).
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question