Thread: Outlook Email
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default Outlook Email

Hi Nigel,

See Ron de Bruin's suggestions at:

http://www.rondebruin.nl/mail/prevent.htm

See also:

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

---
Regards,
Norman


"Nigel RS" wrote in message
...
Hi All
I am using Outlook to send emails from within Excel 2003. The security
message asking using to confirm they wish to send appears as expected. If
the uses presses 'Yes' everytnig works OK. How do I detect if the user
presses either the 'No' or 'Cancel' control as this causes an error.

Cheers
Nigel RS

Snippet of code follows.....
-----------------------------------------------------------
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)

With OutMail
.To = xmailAdd
.Subject = "CFAM File: " & xFName
.Attachments.Add xmailAttach, olByValue, 1, "Data File"
.DeleteAfterSubmit = False
On Error Resume Next
.Send
End With

Set OutMail = Nothing
Set OutApp = Nothing
--------------------------------------------------------