2 Replies Latest reply on Jul 28, 2009 11:16 AM by Beliakov

    How to get full object of partly selected text?

    Beliakov Level 1

      I selected by textcursor  parts of 2 ajusted paragraphs (for exapmle this can be done if drag cursor thru end part of first para and start part of second para). Then i'd like to have var with object of these 2 full selected paras.

      In other words: how to expand selection of partly selected text (so that to put it later in object var)?

       

      Thanks

        • 1. Re: How to get full object of partly selected text?
          Thomas B. Nielsen Level 3

          var myDocument = app.activeDocument;
          var mySelection = myDocument.selection;

           

          var mySelectedParas = mySelection[0].paragraphs;

          • 2. Re: How to get full object of partly selected text?
            Beliakov Level 1

            Explanation.

            I would like not to select needed text exactly from 1st char of 1st para to last char of last para, but from somewhere among 1st para and somewhere among last para. So that to draw background under selected paras (exactly from top of first to bottom of last paras).

             

            Set mySelectedParas = mInd.Selection.Item(1).Paragraphs

            So after selection i try to do smth like this (in CS3-VBS):

             

            mBnds1 = mySelectedParas.ParentTextFrames.Item(1).GeometricBounds' ' ' '  BUT machin writes "doesnt support..."

             

            And if i try this:

             

            myInd.Select mySelectedParas ' ' ' ' ' 'writes "invalid value for parametr 'SelectableItems' of event 'Select'.

             

            In other words:

            mySelectedParas is not the same type of object as mInd.Selection.Item(1) !

             

            Thanks