Send mail with hyperlink path

CVDK

New Member
Joined
Jul 22, 2009
Messages
35
Hi all
I'm planning to send an e-mail with a hyperlink to an excel file. The link needs to be sort of dynamic in the sense that you update the excel file run the macro which creates a new folder, saves the copy of the original file in the folder and sends an e-mail with a link to the new workbook (so far I can send an e-mail with the workbook) but in order to save (a little) space we just send a link to the file.

The remaining problem is that the path contains a space which f***s up the hyperlink. How do I make the entire path a link (it works if I write the full path so it's static but not if it's dynamic, as it is below)?

Thanks in advance
Christian

Code:
Sub test1()
   Var = <a href=file://" & ActiveWorkbook.FullName & ">Click here</a>"
'   Dim myItem As Outlook.MailItem
'   Dim myOlApp As Outlook.Application
   
   Set myOlApp = CreateObject("Outlook.application")
   Set myItem = myOlApp.CreateItem(olMailItem)
   With myItem
       .To = "recipients"
       .Subject = "Report " & data
       .htmlBody = "<p>Dear Sir </p>" + Var
       .send
   End With
    
End Sub
file://"
 
Last edited:

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

Forum statistics

Threads
1,224,586
Messages
6,179,722
Members
452,939
Latest member
WCrawford

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top