Controlling Office macros and risky attachments
Macros in Word and Excel files have long been a favourite way to deliver malware. This guide explains how to block macros from the internet, allow the ones your business needs and handle other risky attachment types.

Why macros are risky
A macro is a small program stored inside an Office document, usually used to automate repetitive tasks in Excel or Word. Many businesses depend on macros for reports, estimates or templates. The same feature can be abused. For years, a common attack has been an email with a document that asks the reader to enable content. Once they click, the macro downloads and runs malware.
Microsoft now blocks macros in files that come from the internet by default in current versions of Office for Windows. That is a big improvement, but defaults can be changed, older versions may behave differently and attackers have shifted to other file types. A deliberate policy is still worthwhile.
Know which macros you use
Start by finding out where macros are actually used. Ask department leads and look for files with macro-enabled extensions, such as .xlsm and .docm, on shared drives. Often only a handful of people and templates rely on them. Identify who owns each one and where it is stored.
If a macro is important to the business, it should live in a known, controlled location, such as a specific SharePoint library or file share, rather than being emailed around as an attachment.
Set a macro policy
Use Intune or group policy to manage Office macro settings centrally. A common approach for small organizations is to block macros in files from the internet, allow macros only from trusted locations or signed by a trusted publisher, and disable them everywhere else. Trusted locations should be limited to folders that only authorized staff can write to, otherwise an attacker could simply drop a file there.
Digitally signing your own macros is a further step that some organizations take. It lets you trust the publisher rather than the folder, so the macro still works when copied, while unsigned macros stay blocked.
- Block macros in files from the internet
- Allow macros only from trusted locations or publishers
- Keep trusted locations write-restricted
- Prevent users from overriding the policy
Other risky attachment types
As macros became harder to abuse, attackers moved to other formats. These include compressed archives containing programs, disk image files, shortcut files, HTML attachments that open fake sign-in pages, and script files. Very few businesses need to receive these by email.
Configure your email security to block or quarantine high-risk attachment types. Microsoft 365 and Google Workspace both include attachment filtering, and you can add file types to the block list. Consider holding password-protected archives for review, since attackers use passwords to hide contents from scanning.
Add protection on the computer
Email filtering will not catch everything, and files arrive through other routes such as downloads, chat and USB drives. Attack surface reduction rules in Microsoft Defender can block Office applications from creating child processes, injecting code into other programs or creating executable content. Turn them on in audit mode first, check for business impact and then enforce.
Keep Office itself up to date. Microsoft 365 apps update automatically when configured to, and older standalone versions of Office that are out of support should be replaced.
Tell staff what to expect
Staff are the last line of defence. Explain that legitimate documents from your organization will rarely, if ever, ask them to enable editing or content to see what is inside. If an attachment asks them to do that, especially one that arrived unexpectedly, they should check with the sender through a known phone number or ask IT before clicking.
Give people a simple way to report suspicious attachments, such as a report button in Outlook. Reports help IT spot campaigns aimed at your organization and warn others quickly.
- Block macros from the internet and allow only trusted locations or publishers.
- Block high-risk attachment types like archives with programs and disk images.
- Teach staff that a prompt to enable content is a reason to stop and check.