Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Using "mailto" hyperlink to email the workbook as an attachment

I can't seem to figure out how to do this. I want to add a hyperlink to my
Excel Spreadsheet (2003 version) that will allow someone to click on it and
it will automatically construct an email to the specified "mailto" address,
attaching the spreadsheet as an attachment.

Any ideas?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 105
Default Using "mailto" hyperlink to email the workbook as an attachment

You may remove the hyperlink, ans format the cell in underlined blue
like a hyperlink and paste the following macro in the sheet module (it
is assumed that the cell containing the mail address is A1.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address < "$A$1" Or Target.Count < 1 Then Exit Sub
Application.EnableEvents = False
ActiveSheet.Cells.Copy
Workbooks.Add 1
ActiveSheet.Paste ' or maybe do a paste special
With ActiveWorkbook
On Error Resume Next
Kill "c:\temp\attachment.xls"
On Error GoTo 0
.SaveAs "c:\temp\attachment.xls"
.Close
End With
Set OlApp = CreateObject("Outlook.application")
Set m = OlApp.CreateItem(olMailItem)
With m
.Subject = "Subject"
.Body = "Body"
.Recipients.Add Target.Value
.attachments.Add "c:\temp\attachment.xls"
.Send
End With
Target.Offset(, 1).Select
Application.EnableEvents = True
End Sub

HTH
Daniel

I can't seem to figure out how to do this. I want to add a hyperlink to my
Excel Spreadsheet (2003 version) that will allow someone to click on it and
it will automatically construct an email to the specified "mailto" address,
attaching the spreadsheet as an attachment.

Any ideas?



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Using "mailto" hyperlink to email the workbook as an attachment


Check out Ron de Bruin's site where he explains how to send mail from a
range, you can use the worksheet change event and intersect method to
narrow the range. 'Example Code for sending mail from Excel'
(http://www.rondebruin.nl/sendmail.htm)


--
The Code Cage Team

Regards,
The Code Cage Team
http://www.thecodecage.com
------------------------------------------------------------------------
The Code Cage Team's Profile: http://www.thecodecage.com/forumz/member.php?userid=2
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=29214

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
cannot use "Create List" and "Share Workbook" same time Devendra Excel Discussion (Misc queries) 0 October 26th 06 06:05 AM
=HYPERLINK("mailto: KurtB Excel Discussion (Misc queries) 2 October 24th 06 03:05 PM
Using "mailto" function in a macro Mike Excel Discussion (Misc queries) 0 March 24th 06 02:51 AM
copy/convert column email addresses Hyperlink "mailto:" excel97 daleman101 Excel Discussion (Misc queries) 3 November 3rd 05 01:21 PM


All times are GMT +1. The time now is 04:05 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"