Use VBA in MS Word to find all numbers within parentheses, and do calculations on them

I use MS Word for creating exams for my students. Each question is awarded a certain maximum points, which are written inside square parentheses/brackets, e.g.:

Q1. What are the reactants in photosynthesis? [2]

What I am trying to figure out is this: have Word identify all numbers within square parentheses (I only use them for enclosing the points), add them, and display the sum at the top of the exam as the maximum total points.

Top row of exam will look something like this:

Name:________________ Class: ____ Points: ___ of x

Where “x” is where I want the sum to be displayed.

I have used bookmarks and a formula field to calculate the points, but if I change points for a question, I have to redefine the bookmark as well. I would like to avoid this and just have a script that calculates the total points.