Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    Jan 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Conditional Use of DOCPROPERTY fields (Word 2003 SP2)

    I am trying to create a footer which only prints on the last page of section 1. This is straightforward provided I only want to print text "hard coded". What I want to do is to print the contents of a custom field. I had assumed that {if{page}={sectionpages}{DOCPROPERTY "Additional Info" * MERGEFORMAT}} would do the trick (give or take a set of parentheses). But it doesnt!!

    Can anyone suggest a way of doing this? It is almost as if Word will not evaluate the DOCPROPERTY part of the statement if it is within an 'if' condition.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Conditional Use of DOCPROPERTY fields (Word 2003 SP2)

    Welcome to Woody's Lounge!

    Try putting quotes around the DocProperty field:
    <code>
    { IF { Page }={ SectionPages } "{ DocProperty "Additional Info" * MergeFormat }" ""}
    </code>
    On the other hand, it works for me without the quotes. Do you see a footer text on the 3rd and 6th page of the attached document?
    Attached Files Attached Files

  3. #3
    New Lounger
    Join Date
    Jan 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Conditional Use of DOCPROPERTY fields (Word 2003 SP2)

    Hans

    Thanks very much for your speedy response.

    To answer your question, yes - I can see the footers on the 3rd and 6th pages. Unfortunately, even using quotes, I still have problems. This has me stumped. I wondered whether it could be to do with the update of fields prior to printing, but it would seem not to be.

    Time to leave the office, go home and worry about this through the evening.

    Chris

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Conditional Use of DOCPROPERTY fields (Word 2003 SP2)

    If you wish, you can attach a stripped down copy of the problem document. Remove all sensitive information or replace it with dummy text.

  5. #5
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,054
    Thanks
    2
    Thanked 417 Times in 346 Posts

    Re: Conditional Use of DOCPROPERTY fields (Word 2003 SP2)

    Hi Chris,

    The field code you posted should work (it does for me), though it looks like you've omitted a potentially-required space! Instead of:
    {if{page}={sectionpages}{DOCPROPERTY "Additional Info" * MERGEFORMAT}}
    try
    {if{page}={sectionpages} {DOCPROPERTY "Additional Info" * MERGEFORMAT}}

    Cheers
    Cheers,

    Paul Edstein
    [MS MVP - Word]

Posting Permissions

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