Sending outlook mail from excel using VBA

T

Thirusivamani

Run-time error '287'
The following programme throws an error "Application-defined or
Object-defined error" at "Mail.Send"

Can anyone help me to automate outlook from excel VBA.

Dim olApp As New Outlook.Application
Dim Mail As Outlook.MailItem

Set olApp = New Outlook.Application
Set Mail = olApp.CreateItem(olMailItem)

Mail.subject = "test"
Mail.To = "ATH020"
Mail.body = "Hi guys! this is a test mail"
Mail.display
Mail.Send
Set Mail = Nothing
Set olApp = Nothing
 
M

Michael Bauer [MVP - Outlook]

Probably that's subject to the Outlook security model. You can avoid that
e.g. by using the Redemption (www.dimastr.com). One alternative would be to
just display the message and let the user hit the Send button.

--
Best regards
Michael Bauer - MVP Outlook

: VBOffice Reporter for Data Analysis & Reporting
: Outlook Categories? Category Manager Is Your Tool:
: <http://www.vboffice.net/product.html?pub=6&lang=en>


Am Fri, 6 Jun 2008 04:25:01 -0700 schrieb Thirusivamani:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top