Thread: Sending mail
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default Sending mail

Hi David

You miss the send line

Download a example workbook from my site or copy past a example
http://www.rondebruin.nl/sendmail.htm

--

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



"David Gerstman" wrote in message
...
I have a VBA application in which I select information from a spreadsheet
and
send it off to different recipients.

First I set up the Outlook Application with this code:

Dim OutApp As Outlook.Application
Dim OutMail As Outlook.MailItem

Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)

And yes I've included the Outlook Object rererence.

When it's time to send I use the following code:

With OutMail
.To = send_to
.Subject = sub_line
.Body = sum_text
End With

Where each of the variables are stirngs. My problem is that while I'm not
getting any errors, this isn't sending anything.

I cut and paste the Outlook sections from another program that works. So
did
I miss copying something? I've gone over my code and I haven't seen
anything
missing. What could be wrong here.

Thanks,