+ Reply to Thread
Results 1 to 16 of 16

Footer with Field Codes

  1. #1
    Registered User
    Join Date
    07-12-2012
    Location
    Netherlands
    MS-Off Ver
    Word 2003
    Posts
    5

    Footer with Field Codes

    Hi everybody,

    I created a document with 2 footers, 1 left and one right of the document.

    In the left footer I created the following code:

    { = { SECTIONPAGES } - { PAGE } \# " 'Initials:';;" }

    This way my document shows no footer if it only consists of 1 page and a footer on each page other then the last page if it consists of multiple pages. I specifically chose this code instead of the IF code because I need to merge the document, so IF codes are no good.

    In the right footer I created the following code:

    { = { SECTIONPAGES } + { PAGE } \# " 'Page {PAGE} of {NUMPAGES}';;" }

    I did this because other then the left footer, I need the right footer to show on the last page if the document consists of multiple pages.
    The only thing is, that I do not want the right footer to show if the document consists of 1 page, just like I do with the left footer.

    Any suggestions on how to adjust the code in order to get the right footer work the way I want it to?

    So, resuming:

    Document has only 1 page: no left footer and no right footer
    Document has more then 1 page: left footer on every page other then the last page and right footer on every page

    Thanks in advance!

  2. #2
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,831

    Re: Footer with Field Codes

    Try:
    {=({SECTIONPAGES}=1) \# ";;'Page {PAGE} of {NUMPAGES}'"}
    Cheers,
    Paul Edstein
    [Fmr MS MVP - Word]

  3. #3
    Registered User
    Join Date
    07-12-2012
    Location
    Netherlands
    MS-Off Ver
    Word 2003
    Posts
    5

    Re: Footer with Field Codes

    Thanks!

  4. #4
    Registered User
    Join Date
    07-12-2012
    Location
    Netherlands
    MS-Off Ver
    Word 2003
    Posts
    5

    Re: Footer with Field Codes

    Sorry, still got a little problem. I use this document to create letters to our customers. Sometimes I select only 1 customer to merge and sometimes multiple customers. In a 2 page letter, if I select only 1 customer, the code you wrote works just fine. But if I select 2 customers I get the following:
    Customer 1, first page: Page 1 of 4
    Customer 1, second page: Page 2 of 4
    Customer 2, first page: Page 1 of 4
    Customer 2, second page: Page 2 of 4
    In a 1 page letter the code works fine on all selections.

    Any idea how to resolve the page issue on multiple merge selections?

  5. #5
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,831

    Re: Footer with Field Codes

    Change 'NUMPAGES' to 'SECTIONPAGES'

  6. #6
    Forum Contributor mubashir aziz's Avatar
    Join Date
    03-18-2009
    Location
    Lahore, Pakistan
    MS-Off Ver
    MS Office 2013
    Posts
    533

    Re: Footer with Field Codes

    Sorry guys actually this was the code which i was looking for but unfortunately its not working on my side and giving this error !Syntax Error, { in both codes ....
    I"ll be much appreciated if you attach the sample file.
    I"m inserting code in field by clicing Ctrl + F9 in footer.
    If this post helps, Please don't 4get to click the star icon located at the bottom left of my Post.

  7. #7
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,831

    Re: Footer with Field Codes

    Depending on your regional settings, you may need to use:
    {=({SECTIONPAGES}=1) \# ",,'Page {PAGE} of {SECTIONPAGES}'"}

  8. #8
    Forum Contributor mubashir aziz's Avatar
    Join Date
    03-18-2009
    Location
    Lahore, Pakistan
    MS-Off Ver
    MS Office 2013
    Posts
    533

    Re: Footer with Field Codes

    Quote Originally Posted by macropod View Post
    Depending on your regional settings, you may need to use:
    {=({SECTIONPAGES}=1) \# ",,'Page {PAGE} of {SECTIONPAGES}'"}

    I've treid all but all in vain. I'm attaching the file that may be i'm wrongly inputting these formula's .......
    Attached Files Attached Files

  9. #9
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,831

    Re: Footer with Field Codes

    You document has only the outer set of field braces - the others, which should also be field braces, are only ordinary braces.

  10. #10
    Forum Contributor mubashir aziz's Avatar
    Join Date
    03-18-2009
    Location
    Lahore, Pakistan
    MS-Off Ver
    MS Office 2013
    Posts
    533

    Re: Footer with Field Codes

    it seems i'm missing something. Does these braces come like we do ctr+shift+enter in Excel to perform some array formulas?
    sorry I think i really don't know how to enter this code can you explain further please ...

  11. #11
    Forum Contributor mubashir aziz's Avatar
    Join Date
    03-18-2009
    Location
    Lahore, Pakistan
    MS-Off Ver
    MS Office 2013
    Posts
    533

    Re: Footer with Field Codes

    I've tried and insert curely bracket {} by pressing Ctrl+f9 and then write page number inside now by toggeling this field I've got this {=(3=1)\#",,'page 1 of 3'"} but now this error coming !Syntax Error, )
    How can i insert () thru fields ?

  12. #12
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,831

    Re: Footer with Field Codes

    The '()' are just ordinary parentheses, not field braces. Since you're syntax error was originally because you weren't using the field braces properly, your regional settings my not need the alternate syntax I suggested. In that case, use the original one:
    {=({SECTIONPAGES}=1) \# ";;'Page {PAGE} of {SECTIONPAGES}'"}

  13. #13
    Registered User
    Join Date
    07-12-2012
    Location
    Netherlands
    MS-Off Ver
    Word 2003
    Posts
    5

    Re: Footer with Field Codes

    Hi macropod,

    Thank you so much for helping me out. Off course I should have known that I had to change numpages into sectionpages...

  14. #14
    Registered User
    Join Date
    07-12-2012
    Location
    Netherlands
    MS-Off Ver
    Word 2003
    Posts
    5

    Re: Footer with Field Codes

    mubashir aziz,

    If you still get the syntax error try the following: press 4x in a row CTRL-F9 so that you get all the braces you need and then type the syntax within the braces like mentioned above. This should work.

  15. #15
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,831

    Re: Footer with Field Codes

    Quote Originally Posted by emmetje View Post
    If you still get the syntax error try the following: press 4x in a row CTRL-F9 so that you get all the braces you need and then type the syntax within the braces like mentioned above. This should work.
    You need to be a bit more sophisticated than that - your suggestion will produce a set a nested field braces thus {{{{}}}}, whereas what you need is {{}{}{}}.

  16. #16
    Registered User
    Join Date
    07-19-2012
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    25

    Re: Footer with Field Codes

    Quote Originally Posted by macropod View Post
    Change 'NUMPAGES' to 'SECTIONPAGES'
    Agreed........with you.....

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1