Solved

Adding an Excel  Hyperlink in Outlook with an Excel Macro

Posted on 2011-02-24
3
465 Views
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?  
Justin
  With OutMail
            .To = "cscanln@mfglobal.com;"
               
            .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"

                  .Display
        End With
'        On Error GoTo 0
0
Comment
Question by:JCutcliffe
  • 2
3 Comments
 
LVL 76

Accepted Solution

by:
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"

to

.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>"
0
 

Author Comment

by:JCutcliffe
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 = "canlan@mfglobal.com;"
               
            .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>"
                  .Display
0
 
LVL 76

Expert Comment

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

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Learn more about how the humble email signature can be used as more than just an electronic business card. When used correctly, a signature can easily be tailored for different purposes by different departments within an organization.
Use email signature images to promote corporate certifications and industry awards.
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…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

758 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now