Consulting

Results 1 to 1 of 1

Thread: Display all e-mails with certain category in Outlook

  1. #1
    VBAX Newbie
    Joined
    Nov 2021
    Posts
    1
    Location

    Display all e-mails with certain category in Outlook

    I would like to create a macro that will display all e-mails in certain category. So far I am using:

    Sub GDPR()
    Dim myOlApp As New Outlook.Application 
    txtSearch = "category:=(""Personal Data"")"
    myOlApp.ActiveExplorer.Search txtSearch, olSearchScopeAllFolders 
    Set myOlApp = Nothing
    End Sub

    it works but a bit strange, because it also shows an e-mails without any category, but including Personal Data in the body. I thought that the
    category:= syntax is special for categories only, and by using it only categorized e-mail will be returned.
    Any better method to achieve that apart using search function macro?
    Last edited by Aussiebear; 11-18-2021 at 04:31 PM. Reason: Added code tags to supplied code

Tags for this Thread

Posting Permissions

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