Hi Susanne:
OK, you have to understand this mechanism to make it work for you, and you
need a little programming ability. Don't panic, stay with us, and we'll get
there...
Foolishly, I assumed you already knew how to use Fields. That was an error
on my part, because no users these days do know this: it hasn't been in the
Word Help for years. My bad!
A "Field" in Word is an embedded command. It tells Word to perform a
computation and create some text that was not there before. Such as a
number, or the result of a calculation; or to go look someplace and return
the text it finds there, such as a cross-reference or a file name.
In this case, the field we want to use is a SEQ field. It stands for
"Sequence" and it runs a calculation that "adds one to the number from the
previous calculation" (or produces "1" if there was no previous SEQ field in
the document).
First: understand the components of a SEQ field.
The { and } are "bounding characters". They tell Word that what is inside
are codes that it needs to submit to the "Field Engine".
SEQ is the name of a command. It tells the field engine to put a
placeholder in the text and use specific behaviours to decide what text will
appear in the placeholder. In this case, "the next number in the sequence".
Now: The SEQ command expects three parameters in sequence, as explained in
the second page I sent you to:
{ SEQ Identifier [Bookmark ] [Switches ] }
OK, it's "not" explained. I will have to do that
The "identifier" is a name. The name, in this case, of the sequence. You
can have thousands of SEQ fields in a document. Each one needs a name to
say which sequence it belongs to. You will find SEQ fields used most
commonly for Captions, and there you will find they have names such as
"Table", "Figure", "Equation" to say that for example the field is producing
one of the table numbers in the document.
In your case, you are creating three number sequences:
* one to express the Level 1 number, for paragraphs with Heading 1 style,
* one to express the Level 2 number, for paragraphs with Heading 2 style,
* and one to express the Level 3 number, for paragraphs with Heading 3
style.
So I called them "Head1", "Head2" and "Head3", but you can call them
"Sweet", "Sour" and "Pickles" if you like. So long as you then refer to the
correct sequence of numbers in the correct places, you can use any names for
them that you like (but the names cannot contain spaces).
The [ and ] indicate that the parameter is optional: you can leave it out.
We're not going to use a bookmark for this job, so we will leave that one
out.
The next parameter is "switches". A switch must begin with a backslash to
say it is a switch, followed by a letter which stands for a command, and for
some commands, a number that says 'how much' of the command to apply.
In your case, you are using two switches:
\c for continue, which continues the number from the previous SEQ in the
same number series without incrementing it.
And \s for "set to 1". "Set" takes a sub-parameter: the level number of
the heading at which you want the reset to occur.
You can have multiple switches in a SEQ field: {SEQ Test \n \s1\ \h} would
be perfectly valid.
In your case, you want each number series to reset if the higher-level
number series occurs in the document. So you use \s2 in the Head3 number
sequence, which resets the level 3s back to 1 whenever a Level 2 occurs.
So now let's look at the problem you have:
Now the numbering comes out like this, when I try what you said.
G.1
G.1.1
G.2.2
G.3.3
That indicates that you did not try "what I said" but something quite
different, albeit in a somewhat subtle way. Character-for-character
accuracy is essential in computer coding.
If you look at the field codes, you have:
G{SEQ Head2 \c}.{SEQ Head2 \s1}
That is the computer equivalent of a tautology: you are telling Word to
"continue" Head2 and to "reset" Head2. It's going to get very confused.
The first digit that appears in the sequence is generated by your "Head2"
number series (you do not actually use "Head1" in this job, it exists only
to keep things logically easy to understand).
Now: The Head2 series needs to Reset every time a Heading 1 appears. It
needs to increment in each Heading 2. And it needs to Continue in each
Heading 3.
So: In a Heading 1 paragraph, we do not include the Head2 field.
In a Heading 2 paragraph, we include the Head2 field, but with only one
switch, to reset it after a Heading 1 paragraph.
Like this:
G This is a Heading 1 paragraph with Heading 1 style
G{SEQ Head2 \s1}. This is a Heading 2 paragraph
G{SEQ Head2 \s1}. This is a Heading 2 paragraph
G{SEQ Head2 \s1}. This is a Heading 2 paragraph
Now, when we come to the level 3 headings, we need to add a field:
G{SEQ Head2 \c}.{SEQ Head3 \s2}. This is a Heading 3 paragraph
G{SEQ Head2 \c}.{SEQ Head3 \s2}. This is a Heading 3 paragraph
G{SEQ Head2 \c}.{SEQ Head3 \s2}. This is a Heading 3 paragraph
Notice how this time the Head2 sequence "continues". We don't want it
incrementing in a heading 3, we want it to print its existing number from
the Heading 2 paragraph. That's the answer to this specific question of
yours: the Head2 fields need to "continue" in a Heading 3 paragraph.
Notice that we added the Head3 field here? And this one is set to reset on
Heading 2 (the level above) ‹ \s2
What we are NOT showing is the \n switch. That simply says "next: increment
the number by 1 and print it". It's the default, and it's what we want to
happen in the level 3 fields, so we don't bother to include it.
And I want it to do like this
G.1
G.1.1
G.1.2
G.1.3
Can make it do it, but then I have to do like this:
No. You are still thinking of the headings in terms of numbering from the
top. They are in fact "Levels" of headings in a nested outline list.
In your example, G is the top level (level 1), which you do not show.
G.1 is the second level (level 2)
And you have three level 3 headings ‹ G.1.1, G.1.2 and G.1.3
ID{SEQ Head1 \s1}.
ID{SEQ Head2 \c}.{SEQ Head2 \s1}
ID{SEQ Head3 \c}.{SEQ Head2 \s1}
ID{SEQ Head4 \c}.{SEQ Head2 \s1}
Your second, third and fourth lines are showing Head2, Head3 and Head4.
That is creating two more lists that are not part of your numbering
sequence. They should all be "Head3" because they are all members of the
third level of the outline list.
Which takes all kind of practicality form it.. is there another solutions?
Because this means i have to write in front of all, and cant do automatic
updates, but have to change each one, id I out in an extra heading..
No, you have misunderstood. Once you get the codes for each level correct,
you can copy them in front of each heading of that level. Once you have the
correct codes, store them as AutoTexts and you can simply inject the correct
codes after typing the letter at the front of hundreds of headings.
You could make the SEQ field do the letters too, but it gets seriously
complex, so let's not go there.
ANd cant find much help in the two docs you send me.
Sadly, there IS NO good, simple description of how to use SEQ fields out
there on the web. They all "assume" you already know how to use FIELDS, and
continue on to tell you how to do scary things with them.
This explanation here is about as good as you will get!
Feel free to post back as many times as it takes to do this. Fields are
complex little critters, but well within your capabilities, and there is
great power and time-savings available to you if you take the time now to
learn them.
Hope this helps
This email is my business email -- Please do not email me about forum
matters unless you intend to pay!
--
John McGhie, Microsoft MVP (Word, Mac Word), Consultant Technical Writer,
McGhie Information Engineering Pty Ltd
Sydney, Australia. | Ph: +61 (0)4 1209 1410
+61 4 1209 1410, mailto:
[email protected]