Hi Prasant,
Assuming that you want to find the space in a shape other than the text area,
'Left corner of shape
MsgBox ActiveWindow.Selection.ShapeRange(1).Left
'left corner of text
MsgBox ActiveWindow.Selection.ShapeRange(1).TextFrame.TextRange.BoundLeft
'right corner of shape
MsgBox ActiveWindow.Selection.ShapeRange(1).Left +
ActiveWindow.Selection.ShapeRange(1).Width
'right corner of shape
MsgBox ActiveWindow.Selection.ShapeRange(1).Left +
ActiveWindow.Selection.ShapeRange(1).Width -
ActiveWindow.Selection.ShapeRange(1).TextFrame.TextRange.BoundWidth
'top corner of shape
MsgBox ActiveWindow.Selection.ShapeRange(1).Top
'top corner of text
MsgBox ActiveWindow.Selection.ShapeRange(1).TextFrame.TextRange.BoundTop
'bottom corner of shape
MsgBox ActiveWindow.Selection.ShapeRange(1).Top +
ActiveWindow.Selection.ShapeRange(1).Height
'bottom corner of text
MsgBox ActiveWindow.Selection.ShapeRange(1).Top +
ActiveWindow.Selection.ShapeRange(1).Height -
ActiveWindow.Selection.ShapeRange(1).TextFrame.TextRange.BoundHeight
So i guess this might give you an idea where are the shape and text
boundaries and you do your appropriate funtions. Replace selection shape to
your shape.
Thanks,
Vinod