VBA macro to block and delete selected junk mail folder items

Jerry Callahan 0 Reputation points
2025-01-05T20:30:51.9266667+00:00

Outlook 365 for pc does a good job of sending junk email to the junk folder. Unlike when operating in the inbox, blocking a sender does not move the email to the deleted folder. I need a VBA script that I can execute from the "junk folder" view, where I can select one or more email items and for each one put the sender in the blocked senders list and then delete the email item. Unlike Excel, Outlook does not offer a macro record option, so I am at a loss as to how to formulate the VBA code.

Outlook
Outlook
A family of Microsoft email and calendar products.
4,316 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
4,154 questions
{count} votes

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.