• Field code error (word 2003)

    Author
    Topic
    #436170

    I would really appreciate some help on a problem I’m having.

    I am trying to insert an IF field code into a header but get the error “Unknown Op code for conditional.”
    I have attached a sample document giving the error.

    I have also copied the field code in plain text showing the field ends as simple braces.

    Can anyone help?
    I’m hoping to use this field in a header to make the header text conditional.
    The field without the IF works properly, wheter in the body or in the header but the IF field works in neither.

    I chose to use SUM rather than OR because I want to use 8 bookmarks in the condition and SUM seems to allow this.

    Thanks,
    Judith

    Viewing 0 reply threads
    Author
    Replies
    • #1033167

      In your example, the field evaluates to { IF 2 True False }, which I think Word does not understand (i.e., unlike some programming languages, “IF 2” is neither true nor false). What does the “2” signify, or what should it be compared against?

      • #1033173

        Thanks for the reply. It’s getting closer now.

        2 is recognised as FALSE since it’s not 1 – but in the real document the bookmarks P1, P2 etc are never on the same page.

        I found I had to add an operator and a second expression.

        The final field is pretty complex and will need to be revised if I add a Part 9 but it seems to work OK.

        The first page of each Part has a local TOC. If the toc goes to a second page, the header is wrong, but that’s not as bad as having the header wrong for the first page of each Part.

        Thanks,
        Judith

    Viewing 0 reply threads
    Reply To: Field code error (word 2003)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: