Monday 26 January 2015

Send email with range mailing envelope code within excel


Sub Button1_Click()

ActiveSheet.Range("A1:d34").Select

   ActiveWorkbook.EnvelopeVisible = True

  

Application.ScreenUpdating = False

   On Error Resume Next

   With ActiveSheet.MailEnvelope

      .Introduction = "This is a sample worksheet Created by Ramneek."

      .Item.To = "ramneek.sharma@niit-tech.com"

      .Item.Cc = "ramneek.vbaexpert@gmail.com"

      .Item.Subject = "Sending email using the range"

      .Item.Send

   End With

  

   Range("a1").Select

End Sub


No comments:

Post a Comment