Example Numbering in Word

Gary Holton gmholton at ALASKA.EDU
Thu Sep 18 15:48:44 UTC 2008


Stephen,

The tack I've taken to address this problem is to insert a hidden
sequence field just before I want the numbering to restart, and have
that hidden field start at "0", so that the next real (unhidden)
number is 1. You can do this manually by inserting a Seq field with
the appropriate label (I believe Susanna's macro uses "ex" as the
label) and then including the switches "\h \r 0". (Go to Insert|Field,
choose "Numbering" under category and "Seq" under field name.) Or you
could add the following code to Susanna's visual basic macro:

'------------------------------------------------------------------------------------------------
' reset numbering of example fields via hidden ex field
Public Sub ResetExamples()
   Dim fld As Field
   Set fld = ActiveDocument.Fields.Add(Selection.Range,  _
                         wdFieldSequence, "ex \h \r 0")
   fld.Update
End Sub
'------------------------------------------------------------------------------------------------

Once you add that code, you can then call it from the Tools|Macros...
menu as "ResetExamples", or just assign that macro to a menu or
toolbar button.

One caveat, since this inserts a hidden field, it can be difficult to
keep track of once it has been added. If you want to delete these
hidden "reset" fields, do a select all, then right click and choose
"toggle field codes".  Those hidden fields will show up again as {SEQ
ex \h \r 0}, while the regular example numbers will be {SEQ ex },
without the switches.

Note that this approach can be extended in many ways, for example, by
including chapter numbers with your examples, etc.

Happy numbering,

Gary




----------------------------------------------------
Gary Holton
Associate Professor of Linguistics
Alaska Native Language Center
University of Alaska Fairbanks
306B Brooks Building

Postal address:
Box 757680
Fairbanks, AK 99775-7680
USA

Phone, fax, email:
+1 907 474 6585 [voice]
+1 907 474 6586 [fax]
gary.holton at uaf.edu




On Wed, Sep 17, 2008 at 8:01 PM, Stephen Morey <S.Morey at latrobe.edu.au> wrote:
> Dear RNLD members,
>
> Some time ago I learned about Susanna Cumming's very useful Word for
> Linguists site, and learned how to do example numbering so that both
> example numbers and the references to those examples automatically
> update - very useful.
>
> Does anybody know whether it is possible to make the numbering start
> afresh from (1) when you have a new chapter heading, which would be a
> Heading 1 in the Word hierarchy?
>
> I asked Alec Coupe about this, and his response is below; but that's
> rather laborious and would be almost insurmountable with the over 1000
> examples I have in one draft grammar. Can anyone help?
>
> Stephen Morey
>
>
> <ALEC COUPE'S RESPONSE FOLLOWS>
>
>
> Hi Stephen,
>
> I just tried putting in a section break in a document with a series of
> automatically numbered examples in order to create a new section from
> that point onward, but that did not cause the automatic numbering field
> below the break to revert to (1) when I updated the fields, e.g.
> 1
> 2
> 3
> SECTION BREAK
> 4
> 5
> 7
>
> So then I tried removing the auto numbering field from the first example
> below the section break, then selected 'insert' > 'field' etc and
> repeated the whole process of manually inserting the first
> sequentially-numbered field. This had the desired effect of restarting
> at (1), e.g.
>
> 1
> 2
> 3
> SECTION BREAK
> 1
> 5
> 6
> 7
>
> However, the numbers below did not update consecutively, but remained in
> sequence with those of the previous section. The only thing I could do
> to resolve this was to copy the newly created field of (1) below the
> section break and paste it over all the numbers below (1) in the new
> section, then select all > F9 to update fields. This had the desired
> effect, e.g.
>
> 1
> 2
> 3
> SECTION BREAK
> 1
> 2
> 3
> 4
>
> There must be a less laborious way around this, but I don't know what it
> is, other than having the foresight to manually insert an auto numbering
> field afresh each time one starts a new chapter. I have noticed in the
> past that sometimes when I copy and paste sequentially numbering fields
> from another document, they fail to sequentialise when I update the
> fields, but am not sure why this happens unless it is connected to the
> work-around described above. If you are able to work it out, please
> share the resolution with me.
>
> Alec
>
>



More information about the Resource-network-linguistic-diversity mailing list