identify "blank space" through macro

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?
 
V

vindys

Do you mean you trying to find the blank space in a text box or so? Also
whats this sp you mentioned?
 
P

Prasant

Hi vindy

Yes. I want to identify the blank space inside the text box.
Sp is like an keyword or example thought might help.
 
V

vindys

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top