Skip to main content
Suzan_V
Known Participant
April 5, 2016
Question

overflow text in tables

  • April 5, 2016
  • 1 reply
  • 2115 views

Hello all,

kindly i need some help that i can't see or figure overflow (overset) text in table cells in FrameMaker, also i got a code to say if there is overset text or no in document but it doesn't go to the page or select that text frame

my 1st priority to find overflow in table cells

Thanks all in advance

This topic has been closed for replies.

1 reply

Klaus Göbel
Legend
April 13, 2016

Hi Suzan.V

here some lines of code that may help you:

It finds overflowed cells and puts the cursor there.

var oDoc = app.ActiveDoc

var locFlow = oDoc.MainFlowInDoc;

var OverflowFound = false;

var oTables = locFlow.GetText(Constants.FTI_TblAnchor);

for (var i = 0; i < oTables.length; i++)

        {

         var oRow = oTables.obj.FirstRowInTbl; // Zeile 2

         var oCell = oRow.FirstCellInRow; 

          

        while (oRow.ObjectValid ( ) )

            {

                var oCell = oRow.FirstCellInRow; 

                 while (oCell.ObjectValid ( ) )

                    {

                     if (oCell.Overflowed == 1)

                        {

                        var oPgf = oCell.FirstPgf;

                        var tloc = new TextLoc(oPgf, 0)

                        var locTextRange = new TextRange (tloc, tloc);

                        oDoc.ScrollToText (locTextRange);

                        alert ("Overflow");

                        OverflowFound = true;

                        break;

                        }

                   

                    oCell = oCell.NextCellInRow;

                    }   //  while (oCell.ObjectValid ( ) )

           

                if (OverflowFound) break;

                 oRow = oRow.NextRowInTbl;

            }   //  while (oRow.ObjectValid ( ) )

              if (OverflowFound) break;

    }   // for

Suzan_V
Suzan_VAuthor
Known Participant
April 13, 2016

Dear Klaus,

Thanks for your reply and i hope you can help me at this case, but your code seems not working to me

you find a sample file uploaded at below link

http://www.megafileupload.com/rsYN/Sample_file.zip

first i want the code to tell me that there is overflow text on page (1) as shown  and select both those text frames one by one

then ( and that is more important) there are overflow text on three cells as shown but i can't know that until i resize the row format from 5 to 7 or read the text and guess if the context is missing

so if you can't find those overflow text, can you create a script to to resize all tables row format and give them maximum value for ex = 100

Thanks in advance for your help

Klaus Göbel
Legend
April 13, 2016

Hi Suzan,

sorry for my late response, but I'm on a business trip for the rest of the week.

Did you get any error messages?

I've just  tested the script again: it works.

I'm using FrameMaker 2015 and FrameMaker 12.

Which version do you use?

Of course, you need an active document with a table.

And then this ExtendScript runs.

When I download your file I get a virus warning.