2 Replies Latest reply on Feb 14, 2010 10:27 AM by Beliakov

    [CS3-VBA] Is it possible to get VisibleBounds of table

    Beliakov Level 1

      I can get left coordinata of picture in Document:

      mLeft = mParaPic.AllGraphics(1).VisibleBounds(1)

       

      But how can i get the same parametr from table - leftmost border x-coordinata?

       

      Thanks

        • 1. Re: [CS3-VBA] Is it possible to get VisibleBounds of table
          Shonkyin Level 3

          Hi Dmitry,

           

          I have not found any code which can directly access x coordinate of table.

           

          Below is javascript code. It will give you x coordinate value and give you idea for creating VB code.

           

          var myDoc = app.activeDocument;

          var old_hori_measu = myDoc.viewPreferences.horizontalMeasurementUnits;

          var old_hori_measu = myDoc.viewPreferences.verticalMeasurementUnits;

          myDoc.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.points;

          myDoc.viewPreferences.verticalMeasurementUnits = MeasurementUnits.points;

          var mytable =  myDoc.textFrames[0].tables

          app.select(mytable[0].cells[0])

          var old_align = app.selection[0].insertionPoints[0].justification

          app.selection[0].insertionPoints[0].justification = Justification.LEFT_ALIGN

          var mytablexoffset = app.selection[0].insertionPoints[0].horizontalOffset - mytable[1].leftBorderStrokeWeight/2 - mytable[1].cells[0].leftInset

          app.selection[0].insertionPoints[0].justification = old_align

          app.select(null)

          alert (mytablexoffset+"pt")

          myDoc.viewPreferences.horizontalMeasurementUnits = old_hori_measu;

          myDoc.viewPreferences.verticalMeasurementUnits = old_hori_measu;

           

          Here is many script gurus and maybe someone have good idea for this.

           

          Shonky

          1 person found this helpful
          • 2. Re: [CS3-VBA] Is it possible to get VisibleBounds of table
            Beliakov Level 1

            OK. I  did catch idea. Thanks!