Public Sub scanFolder() Dim src As Folder Dim oItem As Object Dim propertyAccessor As Outlook.propertyAccessor Set src = Application.ActiveExplorer.CurrentFolder Dim strHeader As String For Each oItem In src.Items If TypeOf oItem Is Outlook.MailItem And oItem.Categories <> "" Then ' Debug.Print "Cat: " + oItem.Categories Set propertyAccessor = oItem.propertyAccessor header = propertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x007D001E") Dim headerLines() As String headerLines() = Split(header, vbCrLf) Dim thisHeader As Variant For Each thisHeader In headerLines If InStr(thisHeader, "Message-ID:") > 0 Then Debug.Print thisHeader + "~" + oItem.Categories Exit For End If Next End If Next End Sub
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
An Experts Exchange subscription includes unlimited access to online courses.Get Started
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE