Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #8  
Old 07-24-2015, 05:16 AM
Cosmo Cosmo is offline Need help with Field Codes Windows Vista Need help with Field Codes Office 2007
Competent Performer
Need help with Field Codes
 
Join Date: Mar 2012
Posts: 240
Cosmo is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
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" }
Yes this is being used in a mail merge, but it may also be used in a standalone user-entered document.
Quote:
Originally Posted by macropod View Post
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.
Thanks for the info, I was definitely not aware of this. Is the IF field converted before the merge or after? Currently, I have this field at the bottom of the first page, and the CONT bookmark will most likely appear on the second page, but I want to make sure it is flexible enough to handle if the data is longer than an extra page. I may have to put a similar field into the footer for the next section which will need to appear on each page except for the last page, so it sounds like I can't use an IF field for this. Is there a solution that would do this in a mail merge?
Quote:
Originally Posted by macropod View Post
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.
Thanks, I will try this out to see if this does what I need. The bookmark will be the start of the next section

I appreciate all of the input.
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Copying Raw Field Codes ptmuldoon Word 3 01-04-2015 02:50 PM
Need help with Field Codes How to hide field codes from others? lucky16 Word VBA 2 10-24-2014 03:52 AM
VBA script to update field codes? Calab Word VBA 1 04-07-2014 09:27 PM
Formula Field using Field Codes hunter2193 Word 3 04-05-2013 04:58 AM
Need help with Field Codes Word Equation field codes mkarthic Word 1 12-02-2011 02:09 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:58 AM.


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