Word: Check if numbers are consecutive

Joined
Nov 2, 2011
Messages
2
Reaction score
0
Hello!
I found a very useful solution on this forum, so I tried to look for another tweak, but with no luck. Let me explain.
I have a document that is composed as follows:

PAGE 1
1)
Hi there!
2)
Hey! How are you?
3)
I'm funny, thanks!

PAGE 2
1)
That sounds good!
2)
Let's have a joke beer.

etc.. for hundreds of pages, that may contain dozens of consecutive numbers.

I would like to run a check and see if there are the following errors:
The page number is wrong, as it is not the next one: for example after page 1 I make a mistake and type page 22
The numbers are consecutive: after a 1) the next number followed by the character ) is not 2 and so on.

Basically I think about a macro that loops:

a search for the word "page" followed by a number;
remembers this number;
then searches for the string ")" and examinates what preceeds it from the beginning of the text line;
this value should be "1" if it is the first occurrence of the search after "page x" where "x" is a number (so actually the first search could be "1" provided that this should be the only text in that line);
if before the next page or ) there is no "1)", then prompt me if I want to amend it (it may be a page with no numbers so I typed a note in there)
after finding "1)", it should go on and look for the next numer "2)" that should also be the only text in the line;
if it finds something like 3) or hello) instead, then the macro should prompt me a question: if I want to amend it by typing the new number; or if I want to ignore this error and look for the next ) and check or, if it was the last of the page, then look for the next PAGE x;
if the next page is correctly numbered then start the loop over; if it is not, again prompt what to do;
and finally, if there aren't any more pages, end the loop!
Does it make any sense?
I think this may as well be a bit of a challenge, I thought about some formulae on excel, but I really need to do this on Word...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top