Share via

How to remove w:rsidRPr tags from Word document?

Hans 20 Reputation points
2025-11-01T15:52:31.3666667+00:00

When editing a Word document, Word saves w:rsidRPr tags to track revisions. These tags lead to fragmentation of the document and bloat the file.

You can see these tags when unzipping the .docx file and opening document.xml.

We don't work with revisions in our company, and therefore I want to remove these tags and "defragment" the document.

There used to be a setting 'Store random numbers to improve combine accuracy' in Options | Trust center. Unchecking this setting prevented further fragmenting. But this setting has disappeared.

So how can I remove the tags from the document? I would prefer to use VBA. But any other method is welcome.

Microsoft 365 and Office | Word | For business | Windows

Answer recommended by moderator

  1. John Korchok 231.8K Reputation points Volunteer Moderator
    2025-11-01T16:27:25.1133333+00:00

    XML tags add only a tiny amount to the file size of a document. And manually removing tags is error-prone and can easily render your file unreadable.

    You can edit OOXML using C# in Visual Studio using the Open XML SDK. It's not a beginner project.

    I've written a VBA add-in that allows you to edit PowerPoint XML in VBA, feel free to download it and modify to work with Word. Edit OOXML with VBA – Cool Code Also not a beginner project.

    Was this answer helpful?

    2 people found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Hans 20 Reputation points
    2025-11-01T16:50:59.8866667+00:00

    Hi John

    Thank you very much for your prompt reply. So it seems that Word has no built-in method nor VBA method.

    I consider editing the XML directly. I'm aware that this is not easy. I'll use your examples to get into it.

    Best regards

    Hans

    Was this answer helpful?

    0 comments No comments

Your answer

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