mapping from token to text/number pair
I would like to set up a mapping from a token to a pair so that occurrences of the token in the document can be replaced (either dynamically or by post-processing) by a label (which is a text string) and a value (which is another text string). I am using the word "token" with some caution, hopefully avoiding words that already have special meaning in the Word context.
An example triple: token=bk, label="book", value="12x". The tokens are unique.
There may be thousands of such mappings, so ideally the triples of token/text/number would be defined in an Excel spreadsheet. The spreadsheet would have 3 columns, one each for token, label, and value.
In the document, all I want to show is the token. For example, an XML-style token (which would be perfectly fine if I knew how to do the rest) might be <bk/>. I want to be able to modify the spreadsheet, by adding and deleting tokens, and by modifying their labels or values. These updates should then be reflected in the document.
I have done this before in both XML/XSLT and TeX contexts, but not with Word. Maybe this could be done with a VB macro? Unfortunately I don't know VB at all.
Any input is appreciated!
|