ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Excel and Email (https://www.excelbanter.com/excel-worksheet-functions/90725-excel-email.html)

carl

Excel and Email
 
I am using this code to send emails from an excel workbook.

Is there a way to add the "From" information.

'Sub Mail_ActiveSheet_Body()
Dim OutApp As Outlook.Application
Dim OutMail As Outlook.MailItem
Application.ScreenUpdating = False
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
With OutMail


.To = "ABC.com"
.CC = "EFG.com"
.BCC = ""
.Subject = Sheets("trading").Range("A9").Value
.HTMLBody = SheetToHTML(ActiveSheet)
.Send 'or use .Display

Thank you in advance.



Ron de Bruin

Excel and Email
 
Hi Carl

With CDO it is possible but not with Outlook as far as i know.

See
http://www.rondebruin.nl/cdo.htm

--
Regards Ron de Bruin
http://www.rondebruin.nl


"carl" wrote in message ...
I am using this code to send emails from an excel workbook.

Is there a way to add the "From" information.

'Sub Mail_ActiveSheet_Body()
Dim OutApp As Outlook.Application
Dim OutMail As Outlook.MailItem
Application.ScreenUpdating = False
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
With OutMail


.To = "ABC.com"
.CC = "EFG.com"
.BCC = ""
.Subject = Sheets("trading").Range("A9").Value
.HTMLBody = SheetToHTML(ActiveSheet)
.Send 'or use .Display

Thank you in advance.






All times are GMT +1. The time now is 08:12 PM.

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