View Single Post
 
Old 08-05-2019, 09:14 PM
Swarup Swarup is offline Windows 10 Office 2016
Competent Performer
 
Join Date: Jul 2018
Posts: 185
Swarup is on a distinguished road
Default

Using the example given in Greg Maxey's site, I was able to set up the "X of Z" for the first chapter using the simple approach "{ page } of { SectionPages }". It worked beautifully! And Greg explained that this simple approach cannot be used for the subsequent chapters, as in the "X of Z" for chapters after the first, we will again want X to be starting from 1. (Whereas in the regular page number field we need it to be of an ongoing nature from one section to the next.)

To solve this, Greg guides to create a bookmark at the end of every chapter (i.e. end of every section), and then to use this following model to get the X of Z to restart at the beginning of every section with an X of 1--

{={ Page }-{ PageRef mybookmark } }

So in chapter two, I tried taking the page field, highlighting and toggling it, then changing its contents to the above (where I substituted 'mybookmark' with D37 which is the bookmark I had created). When I again toggled the field code to get the result, it gave the message "syntax error". Any suggestion what is the syntax error I made?

The field code is currently:

{PAGE \* Arabic \* MERGEFORMAT }

In place of that I put:

{={ Page }-{ PageRef D37} }

When I again toggled the field code to get the result, it gives me "syntax error".

I also tried the below, as the when I toggle the field code, for the page number this is what actually appears: { PAGE \* Arabic \* MERGEFORMAT}. So I kept all of that, and tried simply adding the rest of the code given in Greg's site to minus the PageRef of the page before the given section begins.

{={ PAGE \* Arabic \* MERGEFORMAT}-{ PageRef D37} }

But when I again toggled the field code to get the result, it again gives me "syntax error".

I also tried capitalizing the word "page", as MS word had it capitalized:

{={ PAGE }-{ PageRef D37} }

But it still gives me "syntax error".

Last edited by Swarup; 08-06-2019 at 06:38 AM. Reason: Added the code for further attempts to get it right
Reply With Quote