I need to create a way of checking various codes in a Word document. These codes are usually a letter followed by a hyphen and 5 digits, eg M-81406. We need to check that these pre-defined codes have been typed in correctly (there is a pre-determined list of several thousand codes). We cannot use normal Word spell checking as you cannot mis-spell a number (you need at least 2 letters).
I figured I could write a macro that passes over all of the text and finds any that may be invalid. I can easily use regular expressions to check them. My question is, in a macro can I refer to a custom dictionary as the reference list of codes? As in, am I able to access the contents of a custom dictionary from a macro? I ask because this custom dictionary has already been made. I really just need a solution that is going to be able to be updated by the client easily.
Bonus points to anyone who suggests a clever way of highlighting the incorrect codes.