MS Word VBA code to display different versions of a document by making paragraphs invisible based on a code

Perhaps you want 3 versions of a document, but do not want to maintain 3 seperate files.
It may be handy to be able to see all versions at one time to check all content.
Having all paragraphs in one document means that an update to a paragraph will automatically update all versions that use that paragraph.

The VBA code that I used is here.
The word document containing this macro is here.

In the document, command-6 has been assigned to run the macro.

The macro asks for a key letter.
If the key letter is contained within the first marker word of a paragraph, then the paragraph (minus the first word) will be displayed.
If a paragraph has one or less characters, then it is also displayed (to preserve blank lines).
(I set the minimum for testing at 2 characters as I can use one letter e.g. A to display all paragraphs)
All other paragraphs are marked as hidden.

No comments:

This post contains some responses to questions that I have been asked by various people over the last few years. In most cases, I have also posted the information on relevant online community forums such as I hope that you find this useful. Stephen Digby