Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
{ PAGE } field within an { IF... } statement does not updateduring a mail merge.
I had to look back through the Word versions to check this, but as far
as I can tell, the behaviour is as you say: a. in Word 2000 - i.e., the result of the IF is "{ PAGE } of { NUMPAGES }" or "" b. in Word XP and later, the result of the IF is the fully resolved "1 of 1" or "" c. However, (b) is true whether the IF is in the header/footer or in the body. So I think the only reason you are gettina more sensible result in the body is because the correct value of PAGE is used each time the IF field is resolved. When the IF is in the header, I think Word uses the values of { PAGE } and { NUMPAGES } at the point where it evaluates the header/footer, and the problem with that is that the header is the same for all pages in the section - i.e. you get page 1 for every page. The only way I can think of that might get around this is to use the much nastier: { PAGE \#"{ IF { MERGEFIELD Property_State } = "VA" "'Page '0' of '" "" }"}{ NUMPAGES \#"{ IF { MERGEFIELD Property_State } = "VA" "0" "" }" } and since I haven't tested thoroughly, I'm not certain that will work either. Peter Jamieson http://tips.pjmsn.me.uk On 06/11/2009 15:58, Dan George wrote: One more test. I put the code in the header and it fails. So the { PAGE } field will update in an { IF... } statement if within the body of the document, but not within the header or the footer. Dan George wrote: { PAGE } field within an { IF... } statement does not update during a mail merge. 06-Nov-09 I did some more testing. If I move the code out of the footer, the page number updates in the merged document. Previous Posts In This Thread: EggHeadCafe - Software Developer Portal of Choice Integrate Windows Live ID Authentication with ASP.NET Membership, Profiles and Roles http://www.eggheadcafe.com/tutorials...s-live-id.aspx |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Page number x of y not updating in Header with Word 2007 | Microsoft Word Help | |||
unable to add page number using word 2007 template number missing | Microsoft Word Help | |||
Updating table of content for page number only | Microsoft Word Help | |||
How to use mailmerge feature to generate report? (i.e. SQL statem | Mailmerge | |||
How do I find a template for making my own college mission statem. | Page Layout |