Thread: [Solved] Need help with Field Codes
View Single Post
 
Old 07-24-2015, 12:29 AM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Cosmo: I note that you've posted your question in the mailmerge forum. If this is indeed for a mailmerge, you need to be aware that your field code won't work. For starters, it would need to appear more like:
{IF{PAGEREF CONT}>{={PAGE}+1} "page {PAGEREF CONT}" "the following page" }
Even then, however, because IF fields get converted to their results immediately the merge for each record is executed, you'd only ever get the "the following page" output. Furthermore, since you can only have one instance of a given bookmark in a document, the bookmarks, too, get deleted. Consequently, all you're left with is field coding that can do something based on the number of pages in a Section. The following construction will do that and survive a mailmerge:
{={SECTIONPAGES}-{PAGE}-1 \# "'page {QUOTE{={PAGE}+2}}';;'the following page'"}
Note that you'll need to update the fields in the output document (e.g. via Ctrl-A, F9), post-merge, to get the correct text output.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote