Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default { 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

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Page number x of y not updating in Header with Word 2007 PcJunkie7 Microsoft Word Help 1 January 29th 09 09:28 AM
unable to add page number using word 2007 template number missing deemuk Microsoft Word Help 6 November 24th 08 01:17 PM
Updating table of content for page number only Rahul Microsoft Word Help 2 May 2nd 07 07:22 AM
How to use mailmerge feature to generate report? (i.e. SQL statem will~ Mailmerge 1 April 11th 06 09:25 AM
How do I find a template for making my own college mission statem. dasgilly Page Layout 0 March 15th 05 09:03 AM


All times are GMT +1. The time now is 08:31 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"