Advertisement
Guest User

Untitled

a guest
Sep 17th, 2015
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. Arq Gestor Email
  2. 325.txt AA test@email.com
  3. 326.txt AB test@email.com
  4. 328.txt AB test@email.com
  5. 327.txt AC test@email.com
  6.  
  7. i = 1
  8.  
  9. Dim anexo As String
  10. anexo = ""
  11.  
  12. While Lista.Cells(i, 5).Value <> ""
  13.  
  14. destino = Lista.Cells(i, 3).Value
  15. gestor = Lista.Cells(i, 2).Value
  16. arquivo = Lista.Cells(i, 1).Value
  17. anexo = Caminho & arquivo
  18.  
  19. Call SendAttach(anexo, Lista, gestor, destino, antecipado, i)
  20.  
  21. i = i + 1
  22. Wend
  23.  
  24. Set olApp = Outlook.Application
  25.  
  26. Set olMsg = olApp.CreateItem(0) ' email
  27.  
  28. Set olAtt = olMsg.Attachments
  29.  
  30. olAtt.Add (anexo)
  31.  
  32. ' send message
  33.  
  34. With olMsg
  35.  
  36. .Subject = "Movimentação Gestor " & gestor
  37.  
  38. .To = destino
  39.  
  40. .HTMLBody = "Segue em anexo a movimentação do gestor " & gestor & corpo & "."
  41.  
  42. .Send
  43.  
  44. End With
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement