Results 1 to 5 of 5

Thread: Scrape "Certified Mail" Permission from Outlook using VBA

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    To scrape "Certified Mail" permissions from Outlook using VBA, use the following concise script:
    Sub ScrapeCertifiedMail()
        Dim OutlookApp As Object
        Dim Inbox As Object
        Dim Mail As Object
        Dim Items As Object
        Dim i As Integer    
        ' Initialize Outlook objects
        Set OutlookApp = CreateObject("Outlook.Application")
        Set Inbox = OutlookApp.GetNamespace("MAPI").GetDefaultFolder(6)
        Set Items = Inbox.Items    ' Loop through emails
        For i = 1 To Items.Count
            Set Mail = Items(i)
           ' Identify certified mail
           If Mail.MessageClass = "IPM.Note.SMIME" Then 
               Debug.Print "Certified Mail: " & Mail.Subject
           End If
        Next i
    End Sub
    This script identifies emails marked as certified mail by checking the message class.
    Last edited by Aussiebear; 09-28-2024 at 12:43 PM. Reason: Indented code sample

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •