Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #16  
Old 08-07-2019, 01:04 PM
Swarup Swarup is offline How to add a running tally of "page # per # of pages in chapter" in lower right corner of footer Windows 10 How to add a running tally of "page # per # of pages in chapter" in lower right corner of footer Office 2016
Competent Performer
How to add a running tally of "page # per # of pages in chapter" in lower right corner of footer
 
Join Date: Jul 2018
Posts: 185
Swarup is on a distinguished road
Default


I corrected this line as suggested, and the macro ran. Every other page of this 300+ page document is now literally 80% of the page filled with 30 lines of code. And every other page has code in the footer as well as the header, although when the macro asked me whether I wanted the work done in the header or footer, I selected the footer. What the output of all these mountains of code is, is not clear to me. I highlighted some of it and right clicked and selected Toggle Codes, and on some pages it actually showed me a "page 2 of 8 section pages". But most of the pages have just huge amounts of code on them which does not give any output even when one right clicks to toggle the code. All told, it looks like a disaster. I could never trust my file with this macro.

I would prefer to do this work manually, chapter by chapter, putting in the codes myself. If you could help me to just figure out why although the two individual fields I made did yield proper output, but when I put them into the parent field it is giving a syntax error. At least I have control over it when I do it chapter by chapter myself. Kindly help to clear up why the parent field is not yielding the desired output.
Reply With Quote
  #17  
Old 08-07-2019, 03:56 PM
Swarup Swarup is offline How to add a running tally of "page # per # of pages in chapter" in lower right corner of footer Windows 10 How to add a running tally of "page # per # of pages in chapter" in lower right corner of footer Office 2016
Competent Performer
How to add a running tally of "page # per # of pages in chapter" in lower right corner of footer
 
Join Date: Jul 2018
Posts: 185
Swarup is on a distinguished road
Default

I found out the solution as to why I was getting the syntax error. As mentioned earlier, I was typing the {} myself. But one cannot do that; one has to do ctrl F9 to create the {}, and then only it will function as a field. I will go ahead and create all these fields myself for every chapter-- although it may take a bit of time, but it will work out perfectly.


Thank you!
Reply With Quote
  #18  
Old 08-12-2019, 05:30 PM
Swarup Swarup is offline How to add a running tally of "page # per # of pages in chapter" in lower right corner of footer Windows 10 How to add a running tally of "page # per # of pages in chapter" in lower right corner of footer Office 2016
Competent Performer
How to add a running tally of "page # per # of pages in chapter" in lower right corner of footer
 
Join Date: Jul 2018
Posts: 185
Swarup is on a distinguished road
Default

I was able to manage all 49 chapters of this 300 page text with the parent field, sub-fields, and bookmarks for each chapter. Everything worked out perfectly.

The only problem I am facing in this connection is the preface, which is in roman numeral page numbers. The page number field works fine; however in the "X of Z", where X is {={ Page }-{PageRef S1} }, and Z is {SectionPages}, and the entire expression is {={ Page }-{ PageRef S1 } } of { SectionPages }, here the "{={ Page }-{ PageRef S1 } }" is yielding the result "!Undefined Bookmark, XIII".

I have tested the individual fields, and both work. That is, { Page } gives the result xiii, and { PageRef S1 } gives the result xi. But "{={ Page }-{ PageRef S1 } }" is yielding the result "!Undefined Bookmark, XIII". The needed result would have been "ii", that is, the roman numeral for "2".

Any idea why this error is occurring? Is it that MS Word cannot manage subtraction of roman numerals? (I wouldn't think roman numerals would be at all an issue, but I cannot find any mistake with the syntax.)
Reply With Quote
  #19  
Old 08-12-2019, 08:31 PM
Guessed's Avatar
Guessed Guessed is offline How to add a running tally of "page # per # of pages in chapter" in lower right corner of footer Windows 10 How to add a running tally of "page # per # of pages in chapter" in lower right corner of footer Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,932
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

The maths involved require arabic numbers.

Add a switch to each inner field
{={ Page \* Arabic }-{PageRef S1 \* Arabic} }
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #20  
Old 08-12-2019, 08:52 PM
Swarup Swarup is offline How to add a running tally of "page # per # of pages in chapter" in lower right corner of footer Windows 10 How to add a running tally of "page # per # of pages in chapter" in lower right corner of footer Office 2016
Competent Performer
How to add a running tally of "page # per # of pages in chapter" in lower right corner of footer
 
Join Date: Jul 2018
Posts: 185
Swarup is on a distinguished road
Default

Perfect! It worked.

Now, the only problem is that it is giving the result as "2". Can I set it so that it will convert the result, so that it appears as "ii"?

Right now it is showing as "Page 2 of ii". I need it to show as "Page ii of ii".

Normally, when I highlight a page number field and right click on it, among the options are "Edit Field", and there one can set the format of the result to Arabic, Roman numeral, etc. But when I highlight the result of the calculated field we are discussing, the "Edit Field" option is grayed out. Is there another place where I can set the format of the resultant number?
Reply With Quote
  #21  
Old 08-13-2019, 12:19 AM
Guessed's Avatar
Guessed Guessed is offline How to add a running tally of "page # per # of pages in chapter" in lower right corner of footer Windows 10 How to add a running tally of "page # per # of pages in chapter" in lower right corner of footer Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,932
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

You know you can experiment yourself with things that you learn along the way...
{={ Page \* Arabic }-{PageRef S1 \* Arabic} \* roman}

Once you start building nested fields, you need to learn to edit field values without relying on the GUI. Select the field and right click and toggle field codes.

To learn all the switches for fields, use the Edit field option on a simple field and experiment before building nested fields. Separate fields to stand alone so you can test and understand the results of each piece before trying to nest fields.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #22  
Old 08-13-2019, 05:46 AM
Swarup Swarup is offline How to add a running tally of "page # per # of pages in chapter" in lower right corner of footer Windows 10 How to add a running tally of "page # per # of pages in chapter" in lower right corner of footer Office 2016
Competent Performer
How to add a running tally of "page # per # of pages in chapter" in lower right corner of footer
 
Join Date: Jul 2018
Posts: 185
Swarup is on a distinguished road
Default

Yes, wow, thank you -- everything is working perfectly now. That was loads of help! Never would have thought of it myself.

I will surely take your advice and try to learn about the various switches available for use in fields. And little by little, I am getting the hang of how to test all the nested fields to see where a problem is and to confirm that everything is working as it should. Many thanks!
Reply With Quote
  #23  
Old 08-14-2019, 01:00 PM
Swarup Swarup is offline How to add a running tally of "page # per # of pages in chapter" in lower right corner of footer Windows 10 How to add a running tally of "page # per # of pages in chapter" in lower right corner of footer Office 2016
Competent Performer
How to add a running tally of "page # per # of pages in chapter" in lower right corner of footer
 
Join Date: Jul 2018
Posts: 185
Swarup is on a distinguished road
Default

One problem has come up, and I tried to figure it out, but without success. I would like to set up the same structure (page X of Z) for the footer of my TOC. The TOC starts on page 9 of the file, and page numbering itself I have set to start with the TOC, so starting with page 9. I put a bookmark on the page before the TOC, so as to use it in the PageRef field. But it didn't work and I realized that the reason is, the page on which I put the bookmark has no page number. It needs to be assigned as page 8, so I can use it in the PageRef field. But I don't want there to be a "page 8" showing on the page. So I need to assign that page a page number, without having it show when I print it. And I feel foolish for asking, but I don't know how to do this. Your guidance here will be so helpful.
Reply With Quote
  #24  
Old 08-14-2019, 04:04 PM
Guessed's Avatar
Guessed Guessed is offline How to add a running tally of "page # per # of pages in chapter" in lower right corner of footer Windows 10 How to add a running tally of "page # per # of pages in chapter" in lower right corner of footer Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,932
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Every page has a number. Even if it doesn't include a field which shows its number, it still has one.

However, my recommendation is to not overthink this problem. You can hard code the number and move on. That hard coded number can be used in a field too. eg
{={ Page \* Arabic }-8 \* roman}

The complexity of 'add a bookmark and then use a ref field to find out what page number that bookmark is on' is not always warranted and far from bulletproof. That approach makes sense when setting up a big file where any edits in front of that point could change the start page number and break anything hard coded. However in the case of the TOC this is far less of a problem.
1. It has very little in front of it that could be edited.
2. Edits to the preceding info is unlikely to change pagination because it won't typically be large edits.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #25  
Old 08-14-2019, 04:40 PM
Swarup Swarup is offline How to add a running tally of "page # per # of pages in chapter" in lower right corner of footer Windows 10 How to add a running tally of "page # per # of pages in chapter" in lower right corner of footer Office 2016
Competent Performer
How to add a running tally of "page # per # of pages in chapter" in lower right corner of footer
 
Join Date: Jul 2018
Posts: 185
Swarup is on a distinguished road
Default

Wow, very cool. It never occurred to me one could use a hard coded number in the field. Thank you!
Reply With Quote
  #26  
Old 08-14-2019, 06:36 PM
Swarup Swarup is offline How to add a running tally of "page # per # of pages in chapter" in lower right corner of footer Windows 10 How to add a running tally of "page # per # of pages in chapter" in lower right corner of footer Office 2016
Competent Performer
How to add a running tally of "page # per # of pages in chapter" in lower right corner of footer
 
Join Date: Jul 2018
Posts: 185
Swarup is on a distinguished road
Default

I am trying to find the list of available switches for the Page number field. For a simple field like SectionPages, I can opt to have the number appear in Hindi for example. But for a nested field, as the result of {Page} - {PageRef}, if I want the result to display in Hindi I need a switch for that. I tried "\* Hindi", but it did not work.

Update: I found the switch for Hindi. It is "\* HindiArabic".
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to add a running tally of "page # per # of pages in chapter" in lower right corner of footer How do I lower the position of the page number in the footer? lgambis Word 9 02-24-2018 10:38 AM
How to add a running tally of "page # per # of pages in chapter" in lower right corner of footer Bookmark not replaced when inserting but to lower right corner of image newbieX Word VBA 6 11-20-2015 02:03 PM
designating seperate settings (even & odd pages, first page omitted) for header and footer? xhgrrr Word 3 04-02-2015 05:58 PM
How to add a running tally of "page # per # of pages in chapter" in lower right corner of footer Advanced page numbering: section pages in header, document pages in footer Albus Word 12 12-12-2014 01:36 PM
print pages with footer of last page different roytom Excel 1 12-13-2010 02:09 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:55 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft