Word macro to auto add page ranges to a doc index
Hi All:
In an index, Word will only make page ranges instead of individual page numbers (24-28, instead of 24,25,26,27,28) if you use bookmarks. Very tedious, especially with the large index I am producing.
I want to convert the generated index to text (Ctrl shift F9), then run a macro on it to transform, say, "24,25,26,27,28" to "24-28" in each entry. Of course, each entry will have different page numbers to convert.
Has anyone made a macro to do this? I could give it a go, but it is at the limit of my VBA skills. It must involve iterating through the page numbers of each index entry, testing if page number n+1 is one different from page number n, then constructing a suitable string.
Thank you for your time,
Garry
|