Advertisement
Guest User

Untitled

a guest
Jul 26th, 2015
287
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. Public Sub BCC(Item As Outlook.MailItem)
  2.  
  3. Dim objRecip As Recipient
  4. Dim strMsg As String
  5. Dim res As Integer
  6. Dim BCC_ADDR As String
  7. On Error Resume Next
  8.  
  9. BCC_ADDR = "email@email.com"
  10.  
  11. Set objRecip = Item.Recipients.Add(BCC_ADDR)
  12. objRecip.Type = olBCC
  13. If Not objRecip.Resolve Then
  14. strMsg = "Could not resolve the Bcc recipient. " & _
  15. "Do you want still to send the message?"
  16. res = MsgBox(strMsg, vbYesNo + vbDefaultButton1, _
  17. "Could Not Resolve Bcc Recipient")
  18. If res = vbNo Then
  19. Cancel = True
  20. End If
  21. End If
  22.  
  23. Set objRecip = Nothing
  24. End Sub
  25.  
  26. `Public Sub BCC(Item As Outlook.MailItem)
  27. Dim objRecip As Recipient
  28. Dim strMsg As String
  29. Dim res As Integer
  30. Dim BCC_ADDR As String
  31. Dim forward as MailItem
  32. On Error Resume Next
  33. BCC_ADDR = "email@email.com"
  34. Set forward = Item.Forward
  35. Set objRecip = forward.Recipients.Add(BCC_ADDR)
  36. objRecip.Type = olBCC
  37. If Not objRecip.Resolve Then
  38. strMsg = "Could not resolve the Bcc recipient. " & _
  39. "Do you want still to send the message?"
  40. res = MsgBox(strMsg, vbYesNo + vbDefaultButton1, _
  41. "Could Not Resolve Bcc Recipient")
  42. If res = vbNo Then
  43. Cancel = True
  44. End If
  45. Else
  46. foward.Send
  47. End If
  48. Set objRecip = Nothing
  49. End Sub`
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement