Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

Explorer ,
Feb 14, 2010 Feb 14, 2010

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

TOPICS
Scripting
529
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Feb 14, 2010 Feb 14, 2010

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 14, 2010 Feb 14, 2010
LATEST

OK. I  did catch idea. Thanks!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines