R
Roderick O'Regan
Can anyone help with the following, please?
I have a document with a large number of sections. My cursor will be
in the footer of a randomly selected section from which I need to step
forward through each one checking a sequence until the last section is
reached.
In the normal course of events I might use an "On error..." statement
which would occur when arriving at the last section and my code asks
for another one. I would exit from the routine at this point as the
error would be trapped.
However, in this instance, when I arrive at the last section whilst
still in the footers and update my sequence the cursor flips back to
the previous section. The code continues to ask for the next section
and therefore a loop is generated.
I know how to determine the number of sections in a document and also
know how to go to the last one as well as stepping through each
section.
But how can I find out when I've arrived at the last section after
each step through? Is there a way of comparing the index of the
section the cursor is located against the total number of sections?
Regards
Roderick O'Regan
I have a document with a large number of sections. My cursor will be
in the footer of a randomly selected section from which I need to step
forward through each one checking a sequence until the last section is
reached.
In the normal course of events I might use an "On error..." statement
which would occur when arriving at the last section and my code asks
for another one. I would exit from the routine at this point as the
error would be trapped.
However, in this instance, when I arrive at the last section whilst
still in the footers and update my sequence the cursor flips back to
the previous section. The code continues to ask for the next section
and therefore a loop is generated.
I know how to determine the number of sections in a document and also
know how to go to the last one as well as stepping through each
section.
But how can I find out when I've arrived at the last section after
each step through? Is there a way of comparing the index of the
section the cursor is located against the total number of sections?
Regards
Roderick O'Regan