The following is the beginning of my VBA code, which has the core function to make sure the sender verifies that the information is not sensitive when sending emails to a recipient on from a list. I have built this from this forum and a few other forums. Currently, it works awesome for sending email; however, when I send a task with an assignee, it fails at "Set Recipients = Item.Recipients" (located 3rd line from the bottom) with a "Run-time error '438': Object doesn't support this property or method. In the end, I would like to get the recipients of all items, such as both mail and task items, so I can verify them before sending. I have sent appointment/meeting requests with no issues. Is this an achievable goal? I feel it should be. I hope this is enough information to get us started. I appreciate the help in advance.
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim lbadFound As Boolean
Dim send As String
Dim Recipients, Recip, RecipList As String
Dim i As Integer
Dim aFile As String
Dim enviro As String
Dim n As Integer
enviro = CStr(VBA.Environ("USERPROFILE"))
aFile = enviro & "\AppData\Roaming\Microsoft\Outlook\MacroDebug.txt"
n = FreeFile()
Close #n
Set Recipients = Item.Recipients
Dim myNamespace As Outlook.NameSpace
Set myNamespace = Application.GetNamespace("MAPI")
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim lbadFound As Boolean
Dim send As String
Dim Recipients, Recip, RecipList As String
Dim i As Integer
Dim aFile As String
Dim enviro As String
Dim n As Integer
enviro = CStr(VBA.Environ("USERPROFILE"))
aFile = enviro & "\AppData\Roaming\Microsoft\Outlook\MacroDebug.txt"
n = FreeFile()
Close #n
Set Recipients = Item.Recipients
Dim myNamespace As Outlook.NameSpace
Set myNamespace = Application.GetNamespace("MAPI")