Results 1 to 2 of 2
  1. #1
    New Lounger
    Join Date
    Jan 2014
    Posts
    1
    Thanks
    0
    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:

    four
    04

    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:

    Four
    04

    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. Subscribe to our Windows Secrets Newsletter - It's Free!

    Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. #2
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    3,823
    Thanks
    0
    Thanked 168 Times in 155 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 }
    Cheers,

    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
  •