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

    Syntax Error question

    I am attempting to print the integer part of an interest rate in a merge document. MERGEFIELD PNT_12 contains the number 4.625. When I hit [alt] 9, the document says (!Syntax Error,<) but still works somewhat. Here are examples and results. Any thoughts would be appreciated.

    {=INT({MERGEFIELD PNT_12})\# 00}
    {QUOTE {=INT({MERGEFIELD PNT_12})\* CardText \*Caps }}

    When I press [alt] 9 the above statements show

    !Syntax Error, <
    !Syntax Error, <

    When the document is saved with the statements shown as !Syntax Error the results are:


    Notice that the f is lower case even though there is a \*Caps switch.

    When the document is saved with the mergefields toggled to see the Mergefield codes rather than the !Syntax Error, the results are:


    Notice that the f is now capitalized.

    Question: What is wrong with the syntax? Why does it say !Syntax Error,< when I press the [ALT] F9 keys?

  2. #2
    Super Moderator
    Join Date
    May 2002
    Canberra, Australian Capital Territory, Australia
    Thanked 439 Times in 362 Posts
    Are you sure all the field braces (i.e. '{ }') are created via Ctrl-F9? You can't simply type them or copy & paste them from a web site. Nor is it practicable to add them via any of the standard Word dialogues. Furthermore, you have an invalid switch (i.e. '\00') in the first field code.

    FWIW, assuming {MERGEFIELD PNT_12} does indeed return whole numbers for the percentages (e.g. 3.75 instead of 0.0375) your fields could be reduced to:
    {=INT({MERGEFIELD PNT_12}) \* CardText \* Caps }
    If they return only decimal percentages, you could use:
    {=INT({MERGEFIELD PNT_12}*100) \* CardText \* Caps }

    Paul Edstein
    [MS MVP - Word]

Tags for this Thread

Posting Permissions

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