views:

45

answers:

2

Hi All,

I've updated page numbers in my word document using a formula. Now page numbers have series like 1,1,2,2,3,3..

But, the numbers in TOC are still same as previous. I've tried updating them using "Update field" option available in MS Word 2007 & 2010. Can I use formula here also to change page numbers? if yes, how?

Any help on this will be much appreciated!

+1  A: 

It took me a little while to figure this out because I hadn't done it with a formula before, but I found that if toggle the field code for your page numbers in your footer, you'll see the actual formula it is using to show your page numbers, and it should look something like {PAGE}. If you pay close attention, you'll notice that the {} are in bold. What I did to manipulate these page numbers via a formula, I hit CTRL+F9 to get the bold curly brackets, then =, then CTRL+F9 to get another set of curly brackets and typed PAGE inside of those, then after it I typed * 2, then I surrounded {PAGE} * 2 in parenthesis. It resulted in something that looks like this: {=({PAGE}*2)}. The final document has only even page numbers that follow that forumla: 2, 4, 6, 8, etc. Hopefully that helps you in your quest.

TsukiakariUsagi
Yes, with {PAGE} variable it is possible to change page numbers on individual pages but not in TOC.
Mayur
Going with the same *2 formula that I used above, if you go into the TOC (using Office 2k7) you right-click >> Toggle Field Codes on the line you want to edit and you get something that looked like { HYPERLINK \l" _Toc275467522" } with the HYPERLINK portion referring to the actual text for your TOC entry. I double-clicked on the HYPERLINK part and then did another Toggle Field Code and that yielded { PAGEREF _Toc275467522 \h } and then I just changed it to { = ( {PAGEREF _Toc275467521 \h} * 2)}, making sure to use CTRL+F9 to get the curly brackets. Hopefully that helps you further.
TsukiakariUsagi
Bounty awarded for combination of answer and follow-up comment.
Andrew Cooper
+1  A: 

The TOC is built from hidden, internal bookmarks. So every page has a bookmark that is assigned when the TOC is created that starts with _Toc... which is it's logical page number (1, 2, 3, etc.). The TOC does not use what you have changed in the header/footer as the bookmark.

In order to do what you are asking, you will have to assign each of your page numbers to a bookmark and then manually create a TOC with field codes { PAGEREF yourPageNumberBookmark } inside of a { HYPERLINK }

Otaku