identify "blank space" through macro

  • Thread starter Thread starter Prasant
  • Start date Start date
P

Prasant

Hi there,
I'm writing a macro which should read the blank space. Is there any
command/code to identify the blank/null space in coding, something like Sp or
whatever?
 
Do you mean you trying to find the blank space in a text box or so? Also
whats this sp you mentioned?
 
Hi vindy

Yes. I want to identify the blank space inside the text box.
Sp is like an keyword or example thought might help.
 
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
 
Back
Top