R
Roderick O'Regan
I have to create a document which is divided into "chapters".
Each of these "chapters" starts with a numbered style - say SpecialH1
and therefore occurs once only in each chapter.
Within each chapter the user can add sections at random and as many as
needed if they require to turn pages landscape for maps, diagrams and
the like.
If the user is in "chapter" 2 I can allow him to add a new chapter
before the existing chapter 2 (which then becomes chapter 3).
However, if the user's cursor is anywhere within chapter one,
irrespective of the number of sections it may contain I must prevent
them from adding a new chapter ***before*** chapter 1.
At present I'm using the following to tell me in which section the
cursor is in:
thisSection = Selection.Information(wdActiveEndSectionNumber)
This works OK provided there are a finite number of sections within
chapter 1 and by manipulating the information I can prevent users from
inserting a chapter before number 1.
The problem arises when the sections within chapter 1 are varied,
perhaps 2 or 4 or whatever.
Is there a way, perhaps, of selecting the numbered style at the top of
each chapter and identifying at which number it is? If it was at 1
then prevent user from adding another one before it.
Can anyone point me in the right direction, please? My head is going
into "fuzzy mode" trying to identify the way around this!
Regards
Roderick
Each of these "chapters" starts with a numbered style - say SpecialH1
and therefore occurs once only in each chapter.
Within each chapter the user can add sections at random and as many as
needed if they require to turn pages landscape for maps, diagrams and
the like.
If the user is in "chapter" 2 I can allow him to add a new chapter
before the existing chapter 2 (which then becomes chapter 3).
However, if the user's cursor is anywhere within chapter one,
irrespective of the number of sections it may contain I must prevent
them from adding a new chapter ***before*** chapter 1.
At present I'm using the following to tell me in which section the
cursor is in:
thisSection = Selection.Information(wdActiveEndSectionNumber)
This works OK provided there are a finite number of sections within
chapter 1 and by manipulating the information I can prevent users from
inserting a chapter before number 1.
The problem arises when the sections within chapter 1 are varied,
perhaps 2 or 4 or whatever.
Is there a way, perhaps, of selecting the numbered style at the top of
each chapter and identifying at which number it is? If it was at 1
then prevent user from adding another one before it.
Can anyone point me in the right direction, please? My head is going
into "fuzzy mode" trying to identify the way around this!
Regards
Roderick