Thanks to all the replies.
I could get StephenR's to work.
When i tried Krishnakumar's
Function HASTEXTINSHAPE(shpObj) As Boolean
HASTEXTINSHAPE = False
On Error Resume Next
HASTEXTINSHAPE = Len(shpObj.TextFrame.Characters.Count)
On Error GoTo 0
End Function
I couldn't get it to work, but maybe I did something wrong.
As a test, I stuck it into a separate Module in my View Code window.
Then, I made a test Sub Macro2() to call it.
i.e.
Sub Macro2()
x = "Rectangle 168"
If HASTEXTINSHAPE(x) Then
MsgBox x & " has text"
Else
MsgBox x & " has no text"
End If
End Sub
Function HASTEXTINSHAPE(shpObj) As Boolean
HASTEXTINSHAPE = False
On Error Resume Next
HASTEXTINSHAPE = Len(shpObj.TextFrame.Characters.Count)
On Error GoTo 0
End Function
But when I tried running it, I always got "Rectangle 168 has no text", even if I explicitly entered some text there.
Since VBA is far from being my second language, I am sure I am doing something wrong here.
Thanks,
a1
Bookmarks