• Detect number of lines (2003)

    Author
    Topic
    #419630

    Hello All,

    I need to merge 2000+ records. The layout of the master document is mostly tables. I have one field Address at table 1 that is causing an issue. Here goes: Most of the address can fit into one line, but there are at least 20% that wrap to next line. Is there a way to detect using Word Field that if address falls into 2 lines, insert only one Enter at certain position (say X); if address falls into single line, insert two Enters at X. What I meant by Enter is pressing Enter on the keyboard.

    What I did to work around this is to break the tables into a few tables. Insert a frame after X, put all the tables after table 1 into that frame, and lock that frame. It works so far, but I am wondering if there is a way to do it with Word Fields. A wild guess is by calculating number of characters of the address, but I do not think it is accurate.

    Appreciate any suggestion.

    Regards
    Rid

    Viewing 0 reply threads
    Author
    Replies
    • #948099

      Hi Rid,

      Unfortunately, you can’t split a single line into two or more parts with field coding, since Word’s field abilities don’t stretch to parsing text strings. You could if your two-line addresses had each line in a separate field in your source data, though.

      However, even if the source address data consists of a single field, all is not lost. If you put your mergefield into a table cell, then you can use the table cell’s width to force a line-wrap for long lines. With the appropriate paragraph formatting, you can even get the next line to indent so that it is clear in the output that this is a continuation of the previous line. That way, you don’t need to code a line-feed at all.

      If the problem is that you want to force a consistent spacing below the address, a table cell can help with that too. Just set its row height to ‘exact’ for the required height. You can get a similar result for this using fields, provided the source data has separate fields for each address line.

      Cheers

      Cheers,
      Paul Edstein
      [Fmr MS MVP - Word]

    Viewing 0 reply threads
    Reply To: Detect number of lines (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: