ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Sending Mail from within Excel (https://www.excelbanter.com/excel-programming/304939-sending-mail-within-excel.html)

Don Lloyd

Sending Mail from within Excel
 
Hi,

With the help of code obtained from Ron De Bruin's excellent examples I have
code to send a copy of a worksheet directly from Excel.

Conditions
If there is an internet connection the sheet is sent automatically.
If not, a connection dialogue box is shown.
If the user decides to NOT connect the post is placed in the Outbox.

Query
How can I, using code following the SendMail . . . . instruction, arrange
for a message to be displayed, saying that either the Mail has been sent or
has been placed in the Outbox, whichever is the case.

Regards,
Don Lloyd



Ron de Bruin

Sending Mail from within Excel
 
Hi Don

In Outlook you can count the mails in the Outbox

Set myOlApp = CreateObject("Outlook.Application")
Set myOlNS = myOlApp.GetNamespace("MAPI")
Set myFolder = myOlNS.GetDefaultFolder(olFolderOutbox)
MsgBox myFolder.Items.Count

If you need more info about Outlook programming go to the
Outlook newsgroups.


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


"Don Lloyd" wrote in message ...
Hi,

With the help of code obtained from Ron De Bruin's excellent examples I have
code to send a copy of a worksheet directly from Excel.

Conditions
If there is an internet connection the sheet is sent automatically.
If not, a connection dialogue box is shown.
If the user decides to NOT connect the post is placed in the Outbox.

Query
How can I, using code following the SendMail . . . . instruction, arrange
for a message to be displayed, saying that either the Mail has been sent or
has been placed in the Outbox, whichever is the case.

Regards,
Don Lloyd





Don Lloyd

Sending Mail from within Excel
 
Thank you Ron

I'll follow it up.

Don

"Ron de Bruin" wrote in message
...
Hi Don

In Outlook you can count the mails in the Outbox

Set myOlApp = CreateObject("Outlook.Application")
Set myOlNS = myOlApp.GetNamespace("MAPI")
Set myFolder = myOlNS.GetDefaultFolder(olFolderOutbox)
MsgBox myFolder.Items.Count

If you need more info about Outlook programming go to the
Outlook newsgroups.


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


"Don Lloyd" wrote in message

...
Hi,

With the help of code obtained from Ron De Bruin's excellent examples I

have
code to send a copy of a worksheet directly from Excel.

Conditions
If there is an internet connection the sheet is sent automatically.
If not, a connection dialogue box is shown.
If the user decides to NOT connect the post is placed in the Outbox.

Query
How can I, using code following the SendMail . . . . instruction,

arrange
for a message to be displayed, saying that either the Mail has been sent

or
has been placed in the Outbox, whichever is the case.

Regards,
Don Lloyd








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

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