How do I set page numbering in TOC using (page x of y) and section

D

DataRanger

Per article 291283 "How to create two page-numbering schemes in one document
in Word 2002" - how do I set correct page numbering for the Table of Contents?

I was successful in using the Method 1, "Use SEQ fields", but that causes
the numbering in the TOC to start at 1 for every section listed, instead of
showing the real page number based on the total number of pages.

Any help in writing the necessary code will be greatly appreciated.......!
 
S

Stefan Blom

A table of contents always reflects the settings for page numbers
specified for each section (in the Page Number Format dialog box). It
cannot be made to display other types of numbering which is supposed
to imitate page numbers.
 
D

DataRanger

Is it possible instead to use a SEQ field as the "x" value for Sheet X of Y
in the header, and keep the regular page numbering that TOC collects in the
footer?

If this is possible, it would be nice to have the SEQ field automatically
increment or decrement itself as pages are added or removed from a section of
the document.........

Thanks
 
M

Margaret Aldis

Could you use a calculated field for X? Take {PAGE} (with continuous page
numbering) and subtract a {PAGEREF} pointing to a bookmark on the last page
of the previous section?
 
D

DataRanger

Yes, that could be an option:

1. Can the bookmark be auto-generated and added directly to the previous
page as pages are added or removed from a section?

2. Can the bookmark be auto-generated in the footer of the page?

3. What would the code be (look like), to take {PAGE} (with continuous page
numbering) and subtract a {PAGEREF} pointing to a bookmark on the last page
of the previous section?

Thanks....................
 
M

Margaret Aldis

Replies inline:
DataRanger said:
Yes, that could be an option:

1. Can the bookmark be auto-generated and added directly to the previous
page as pages are added or removed from a section?
If you insert the bookmark for each section immediately before or around the
section break it should stay put as you edit the content of the section -
though it is alas always possible to get text the wrong side of the bookmark
(or bookmark start). Or you coulduse a macro to (re)insert the bookmarks at
the section break.
2. Can the bookmark be auto-generated in the footer of the page?

The bookmark doesn't go in the footer, it goes on the last page of the
section.
3. What would the code be (look like), to take {PAGE} (with continuous page
numbering) and subtract a {PAGEREF} pointing to a bookmark on the last page
of the previous section?

{ = {PAGE} - {PAGEREF bookmarkname} }

where bookmarkname is the name of the bookmark at the end of the previous
section - i.e. the footer would be different in each section.

I'm not sure whether you need a more automated solution than this to handle
any number of sections as they are generated. If so you would need to do
something along the lines of creating the bookmarks by macro (name1, name2
.... nameN) at each section break. You could use a similar loop for the
footers, or there may be a clever way of making use of the value of the
{SECTION} field - I'm no field code expert.
 

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