Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. ActiveWorkbook.RefreshAll
  2.  
  3. Dim objOutlook As Object
  4. Dim objMail As Object
  5. Dim ws As Worksheet
  6.  
  7. Set objOutlook = CreateObject("Outlook.Application")
  8. Set ws = ActiveSheet
  9.  
  10. Set objMail = objOutlook.CreateItem(0)
  11.  
  12. With objMail
  13. .To = cell.Value
  14. .Cc = "email@email.com"
  15. .Subject = cell.Offset(0, 1).Value
  16. .Body = cell.Offset(0, 2).Value
  17. .Attachments.Add cell.Offset(0, 3).Value
  18. .Display
  19. End With
  20.  
  21. Set objMail = Nothing
  22. Next cell
  23.  
  24. Set ws = Nothing
  25. Set objOutlook = Nothing
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement