From: Prasant on
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?
From: vindys on
Do you mean you trying to find the blank space in a text box or so? Also
whats this sp you mentioned?

"Prasant" wrote:

> 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?
From: Prasant on
Hi vindy

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



"vindys" wrote:

> Do you mean you trying to find the blank space in a text box or so? Also
> whats this sp you mentioned?
>
> "Prasant" wrote:
>
> > 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?
From: vindys on
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

"Prasant" wrote:

> Hi vindy
>
> Yes. I want to identify the blank space inside the text box.
> Sp is like an keyword or example thought might help.
>
>
>
> "vindys" wrote:
>
> > Do you mean you trying to find the blank space in a text box or so? Also
> > whats this sp you mentioned?
> >
> > "Prasant" wrote:
> >
> > > 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?
From: Steve Rindsberg on
In article <7F9CC857-0262-4A6E-9927-279B25FA44FA(a)microsoft.com>, Prasant wrote:
> 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?

Chr$(20) or " " are equivalent to spaces
VBNullString is a null/empty string

or if you're testing to see if a string is blank:

If Len(string) = 0 Then
Debug.Print "It's blank"
End If



-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================