View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Alvin Hansen[_2_] Alvin Hansen[_2_] is offline
external usenet poster
 
Posts: 209
Default Email again in excel

Hi i use this
Sub Send_Range()
em = Range("gemte!$b$2").Value
' Select the range of cells on the active worksheet.

Sheets("email").Activate
Sheets("email").Range("A1:n71").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 Sheets("email").MailEnvelope
.Introduction = "Mail vedr. Booking Usa"
.Item.To = em
.Item.Subject = "Booking usa"
.Item.Send
End With
MsgBox ("Email er afsendt til: " & em)
End Sub

Now if a user when the dialog box comes up from outlook about sending the
mail say no to sending then i get an error, is there away in this code to
exit sub or something like that if the user say no to sending the mail.

Best regards alvin