ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Link to send file to an e-mail address (https://www.excelbanter.com/excel-discussion-misc-queries/11040-link-send-file-e-mail-address.html)

-PJ

Link to send file to an e-mail address
 
How do I create a link within a workbook to send that workbook to an
indicated email address? Thanks.



galimi

PJ,

The following code will create an Outlook MailItem with the current workbook
as the attachment

Set myOlApp = CreateObject("Outlook.Application")
'Dim myOlApp As New Outlook.Application
Set myitem = myOlApp.CreateItem(olMailItem)
myitem.Display
myitem.Recipients.Add Sheet1.Range("a2").Value
myitem.Attachments.Add ThisWorkbook.Path & "\" & ThisWorkbook.Name

http://HelpExcel.com

"-PJ" wrote:

How do I create a link within a workbook to send that workbook to an
indicated email address? Thanks.



-PJ

Thanks galimi. Unfortunately I'm not very good with the advanced part of
Excel so I'm not really sure where I should be entering this information.
Also, my work only allows me access to certain sites and http://helpexcel.com
is not one of them. Can you please elaborate on your response? Thanks!

-PJ

"galimi" wrote:

PJ,

The following code will create an Outlook MailItem with the current workbook
as the attachment

Set myOlApp = CreateObject("Outlook.Application")
'Dim myOlApp As New Outlook.Application
Set myitem = myOlApp.CreateItem(olMailItem)
myitem.Display
myitem.Recipients.Add Sheet1.Range("a2").Value
myitem.Attachments.Add ThisWorkbook.Path & "\" & ThisWorkbook.Name

http://HelpExcel.com

"-PJ" wrote:

How do I create a link within a workbook to send that workbook to an
indicated email address? Thanks.



galimi

I will post an example to http://www.Galimi.com/Examples by tomorrow

"-PJ" wrote:

Thanks galimi. Unfortunately I'm not very good with the advanced part of
Excel so I'm not really sure where I should be entering this information.
Also, my work only allows me access to certain sites and http://helpexcel.com
is not one of them. Can you please elaborate on your response? Thanks!

-PJ

"galimi" wrote:

PJ,

The following code will create an Outlook MailItem with the current workbook
as the attachment

Set myOlApp = CreateObject("Outlook.Application")
'Dim myOlApp As New Outlook.Application
Set myitem = myOlApp.CreateItem(olMailItem)
myitem.Display
myitem.Recipients.Add Sheet1.Range("a2").Value
myitem.Attachments.Add ThisWorkbook.Path & "\" & ThisWorkbook.Name

http://HelpExcel.com

"-PJ" wrote:

How do I create a link within a workbook to send that workbook to an
indicated email address? Thanks.




All times are GMT +1. The time now is 03:30 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com