VBA & Macro Problems

How to Batch Edit Word Document Metadata on Mac using VBA

Steven ParkerSteven Parker Nov 3, 2026 869 views

Question details

The user needs to modify or remove document properties and metadata in bulk for multiple Word documents located in a specific folder on a Mac using a VBA macro.

How to Batch Edit Word Document Metadata on a Mac with VBA
Product
Microsoft Word
Device & OS
Mac
Scenario
Managing document metadata and properties for multiple files simultaneously without opening them manually.
Observed behavior
The user is looking for an automated VBA script to loop through every document in a chosen directory, target specific metadata fields, apply changes, and save the files automatically.
Before you start

Before running any VBA macro that modifies multiple files automatically, it is highly recommended to create a backup copy of your target folder to prevent accidental data loss in case the macro targets the wrong fields.

Solution 1Recommended

Create and Run a VBA Macro to Batch Edit Metadata

Use a custom VBA macro in Word to loop through a specific folder on your Mac, automatically opening each file to modify or clear its metadata before saving and closing.

Because Mac sandboxing rules restrict background folder access, you may need to grant the word processor explicit permission to access the target folder when the macro runs. The VBA script utilizes built-in property collections to target fields like Author, Title, or Subject.

1
Open the VBA Editor

Launch Word on your Mac, navigate to the 'Developer' tab, and click 'Visual Basic'. Alternatively, press Option+F11 on your keyboard.

2
Insert a New Module

In the Visual Basic editor, right-click on your document project or the Normal template in the left pane, select 'Insert', and choose 'Module'.

3
Write the Batch Process Code

Input your VBA code designed to loop through files. Use the 'ActiveDocument.BuiltInDocumentProperties' collection to specify fields, for instance setting the 'Author' property to a new name or an empty string, followed by a 'ActiveDocument.Save' and 'ActiveDocument.Close' command.

4
Run the Macro

Close the Visual Basic editor to return to your document. Click 'Macros' on the Developer tab, select your new batch editing macro from the list, and click 'Run'.

Create and Run a VBA Macro to Batch Edit Metadata
Mac File Paths in VBA: Ensure your VBA code uses the correct macOS file path formatting (e.g., using POSIX paths with slashes or Mac paths with colons, depending on your specific version) when defining the target folder directory.

Automate Document Management Seamlessly with WPS Office

WPS Office provides excellent built-in support for running VBA macros and modifying document properties, making bulk editing tasks fast and efficient.

  1. 1. Install WPS Office: Download and install WPS Office on your computer for a streamlined document editing experience.
  2. 2. Enable Developer Tools: Open WPS Writer, click the 'Menu' button, go to 'Options', and customize your ribbon to display the 'Developer' tab.
  3. 3. Run Your VBA Script: Open the WPS VBA editor, paste your batch-processing metadata script, and execute it to automatically modify your folder's documents.
Fully compatible with Microsoft Word (.docx, .doc) document formats.Robust VBA macro support for automating repetitive formatting and metadata tasks.Lightweight application with a user-friendly, tabbed interface.Built-in document inspection tools to easily view and modify file properties.
QA img-9

Frequently Asked Questions

Can I remove all personal information from a Word document without VBA?

Yes, you can manually remove properties by navigating to 'File' > 'Info' > 'Check for Issues' and using the 'Inspect Document' tool to strip personal information. However, doing this for an entire folder simultaneously still requires a VBA macro.

Why does my VBA macro fail to open files on a Mac?

macOS utilizes a security feature called sandboxing, which prevents applications from reading or modifying files in folders without explicit user permission. You may need to update your macro to use AppleScript integrations or manually grant folder access.

How do I view document metadata before changing it?

You can view current metadata by clicking 'File' > 'Properties' (or 'Summary Info'). This will display the built-in properties such as Author, Company, Title, and Creation Date.