sending mail from excel ???

  • Thread starter Murat Demir Hekimoðlu
  • Start date
M

Murat Demir Hekimoðlu

Hello All

I want to send e-mail with in Excel with Visual Basic. But when ý use the
code below I get the Dialog Box of Outlook . How can I prevent this
DialogBox to open. Sending mail will be the part of an automatic system
thanx all.

' Select the range of cells on the active worksheet.
ActiveSheet.Range("A1:B5").Select

' Show the envelope on the ActiveWorkbook.
ActiveWorkbook.EnvelopeVisible = True

' Set the optional introduction field thats adds
' some header text to the email body. It also sets
' the To and Subject lines. Finally the message
' is sent.
With ActiveSheet.MailEnvelope
.Introduction = "This is a sample worksheet."
.Item.To = "(e-mail address removed)"
.Item.Subject = "My subject"
.Item.Send
End With
 

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