8 Replies Latest reply on Apr 3, 2017 6:06 AM by Russ Ward

    Counting line in paragraph

    philippep2776167 Level 1



      I usually work with structured FM doc, but for once i need to work with unstructured doc.


      I need to make a script that check if there is only few chararter at the last line of a paragraph, and if yes, to apply a "spread -2%". and check if i lost one line.


      I was thinking, if i can compare the number of line of a paragraph before and after the "spread -2%" and if it's "after" is smaller than "before".

      If yes => i lost one line in my paragraph.


      In million paragaph, i can win few pages in my doc (doc large than 1.000 pages)


      I already have script to walkthrouth all the paragraph of a doc, another to apply and/or check paragraph values (spread).


      But how can i count the number of line in one paragraph?

      Do i have to put my cursor in each line of my paragraph and check the FTI_LineEnd (normal, hard, hyphen) to know when i reach the end of my paragraph? Or there is another way?