How to access BlockedJunkemails folder in outlook via vba macro

Jim Reid 0 Reputation points
2025-05-23T19:18:01.59+00:00

Does anyone know the method of accessing BlockSenders in JunkMailOptions via VBA Macro? It doesn't appear to be part of the Outlook namespace.

Outlook | Windows | Classic Outlook for Windows | For business
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Hornblower409-4652 480 Reputation points
    2025-05-24T05:42:48.0733333+00:00

    Looks to be in different places depending on the account type. And changes depending on the version?

    For Classic Windows
    https://answers.microsoft.com/en-us/outlook_com/forum/all/i-cannot-add-senders-or-domains-to-the-blocked/e54c4c03-34b1-49b9-882e-9d2c691f31b0

    HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles

    For Classic Mac
    https://answers.microsoft.com/en-us/outlook_com/forum/all/outlook-mac-2016-blocked-senders-info-file/f6fea4b3-09bd-4ff8-a150-89ec518e4109

    And changes to the local registry/DB may not be saved.
    https://answers.microsoft.com/en-us/outlook_com/forum/all/outlook-365-blocked-senders-list/9e10ddae-ceb9-4dec-a23e-4f13f7ea51be

    And if they are stored in a hidden message in the Default Store, you will have to dig it out with MFCMAPI?

    0 comments No comments

  2. Jim Reid 0 Reputation points
    2025-05-24T15:49:41.0833333+00:00

    It appears there was a change to Outlook 2024. Suddenly, the macro doesn't work, but the block sender does. Originally, the Block Sender didn't work, so I wrote a macro and put it up, and it worked fine. When it stopped working, I found that the Block Sender is working. The block sender now puts the full email address in the block sender file. I have since written a program that I can export the blocked senders and strip off the email address, and only have the domain name, and then load it back on the import side of the block sender list, and that blocks all the emails from a specific domain. Works great now.

    I'm running Windows 11 Pro with Office 2024

    OutlookVersion

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.