Send E-mail link to a file (not the open Workbook)

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Do you want a link to another file, or exactly the file be put in attachment of the email message?
 
Upvote 0
How far did you get - where did you get stuck?
 
Upvote 0
Well I can see there is a line,

"<A HREF=""file://" & ActiveWorkbook.FullName & _


I assume this needs to be changed. If the file I want to link to is located at C:\Documents and Settings\testfile how do I insert it?

But then there is another line which refers to ActiveWorkbook, i.e.

.Subject = ActiveWorkbook.Name
.HTMLBody = strbody

Do these need to be changed to refer to the new file?

Graham
 
Upvote 0
This line:

Code:
.Subject = ActiveWorkbook.Name

just fills in the Subject of the email. If you want something else, well, change it:

Code:
.Subject = "my new subject"

In Ron's example I gave you, you see the link to his website:

"<A HREF=""http://www.rondebruin.nl/"">Ron's Excel Page</A>"

You need to change the http://www.rondebruin.nl/ for the location of your file. And change the Ron's Excel Page too...
 
Upvote 0
I cannot assess what problems you have with changing the hard-coded elements, but here's an example (delete [ and ] in the line of code):

Code:
.htmlBody = "<[A HREF=""C:\test.txt"">test file<]/A>"
 
Last edited:
Upvote 0
Hi again

I've tried and tried but the macro locks up at the strbody section. It is listed as follows but the problem must be the file location,

strbody = "<font size=""3"" face=""Calibri"">" & _
"Hi Martin,<br><br>" & _
"I refer to this project and can confirm that I now consider the works to be Practically Complete. The date of this, and any outstanding works are listed on the 'PROJECT CLOSURE' spreadsheet for this project. A Stage 4 Safety Audit should be diarised to occur approximately 12 months from this date, and a Stage 4a at 36 months. Results of those Audits should be sent, in the first instance, to the Client Manager. <br>" & _
"<br>To open the file, Right Click on the name and select 'Open Hyperlink' : " & _
"<[A HREF=""[URL="file://\\artemis\transportation\Unit"]\\artemis\transportation\Unit[/URL] Information\Old Medusa Data\SECTION - UNITWIDE\PROJECT MANAGEMENT SYSTEM\poole qualitree.xlsm "">test file<]/A>" & _
"<br><br>Regards," & _
"<br><br>ENTER YOUR NAME HERE</font>" £ _
 
Upvote 0

Forum statistics

Threads
1,224,574
Messages
6,179,628
Members
452,933
Latest member
patv

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