Geoff
If shapes.count > 0
This just checks that there are some shapes on the slide.
Try this code and see if its what you need ( or maybe use it as a starting
point)
Checks all shapes on all slides > Is it a type 14 shape? If yes checks text
for a colon and reports each slide number with colons in turn.
'code starts
Sub Findcolon()
Dim oSld As Slide
Dim oShp As Shape
Dim strtext As String
Dim strchr As String
For Each oSld In ActivePresentation.Slides
For Each oShp In oSld.Shapes
If oShp.Type = 14 Then
strtext = oShp.TextFrame.TextRange
For c = 1 To Len(strtext)
strchr = Mid$(strtext, c, 1)
If strchr = ":" Then MsgBox ("found on slide " & oSld.SlideNumber)
Next c
End If
Next oShp
Next oSld
End Sub
'code ends

Signature
-----------------------------------------
Did that answer the question / help?
_____________________________
John Wilson
Microsoft Certified Office Specialist
> trying to make a little head way myself I have following code which
> does find and select text placeholders but then comes up with an error
[quoted text clipped - 44 lines]
>
> End Sub
Geoff Cox - 08 Jun 2006 11:54 GMT
John,
Thanks for your code ideas - I have tried following but get a runtime
error message,
TextFrame(unknown member): Invalid request. This type of shape cannot
have a TextRange.
Debug points at
strtext = sHp.TextFrame.TextRange
Any thoughts?!
Cheers
Geoff
Sub MyMacro(strMyFile As String)
Dim oPresentation As Presentation
Set oPresentation = Presentations.Open(strMyFile)
With oPresentation
Dim oSld As Slide
Dim oShp As shape
Dim strtext As String
Dim strchr As String
For Each oSld In ActivePresentation.Slides
For Each oShp In oSld.Shapes
If oShp.Type = 14 Then
strtext = oShp.TextFrame.TextRange
For c = 1 To Len(strtext)
strchr = Mid$(strtext, c, 1)
If strchr = ":" Then MsgBox ("found on slide " & _
oSld.SlideNumber)
Next c
End If
Next oShp
Next oSld
oPresentation.Close
Set oSh = Nothing
Set oPresentation = Nothing
End With
End Sub
John Wilson - 08 Jun 2006 14:09 GMT
Debug points at
"strtext = sHp.TextFrame.TextRange "
Note this isnt what my code said!
If this is just a spelling mistake you could maybe try this ammendment
Sub findcolons()
Dim oSld As Slide
Dim oShp As Shape
Dim strtext As String
Dim strchr As String
For Each oSld In ActivePresentation.Slides
For Each oShp In oSld.Shapes
If oShp.HasTextFrame Then
If oShp.Type = msoPlaceholder Then
strtext = oShp.TextFrame.TextRange
For c = 1 To Len(strtext)
strchr = Mid$(strtext, c, 1)
If strchr = ":" Then MsgBox ("found on slide " & oSld.SlideNumber)
Next c
End If
End If
Next oShp
Next oSld
End Sub

Signature
-----------------------------------------
Did that answer the question / help?
_____________________________
John Wilson
Microsoft Certified Office Specialist
> John,
>
[quoted text clipped - 47 lines]
>
> End Sub
David M. Marcovitz - 08 Jun 2006 14:13 GMT
> If oShp.Type = 14 Then
What about:
If oShp.Type = 14 And oShp.HasTextFrame Then
--David

Signature
David M. Marcovitz
Microsoft PowerPoint MVP
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
John Wilson - 08 Jun 2006 14:51 GMT
Both these do pretty well the same job (though DM's is neater!)
The problem is that type 14 shapes include placeholders that cannot have a
text frame (eg picture holders), I guess your presentation had such a
placeholder which would cause the error.

Signature
-----------------------------------------
Did that answer the question / help?
_____________________________
John Wilson
Microsoft Certified Office Specialist
> John,
>
[quoted text clipped - 47 lines]
>
> End Sub
Geoff Cox - 08 Jun 2006 13:47 GMT
John,
Have found that the error message can be avoided using " On Error
Resume Next" etc.
Cheers
Geoff
For Each oSld In ActivePresentation.Slides
For Each oShp In oSld.Shapes
If oShp.Type = 14 Then
On Error Resume Next
strtext = oShp.TextFrame.TextRange
For c = 1 To Len(strtext)
strchr = Mid$(strtext, c, 1)
If strchr = ":" Then MsgBox ("found on slide " &
oSld.SlideNumber & " in " & strMyFile)
Next c
End If
On Error GoTo 0
Next oShp
Next oSld
Steve Rindsberg - 08 Jun 2006 15:22 GMT
Note that you can simplify this:
> strtext = oShp.TextFrame.TextRange
>
[quoted text clipped - 4 lines]
> Next c
> End If
to
If Instr(oShp.TextFrame.TextRange,":") > 0 Then
' the text has been colonized
End If
-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
John Wilson - 08 Jun 2006 16:21 GMT
Thanks Steve - stored in "lessons learned today" box!!!
_____________________________
John
> Note that you can simplify this:
>
[quoted text clipped - 18 lines]
> PPTools: www.pptools.com
> ================================================
Steve Rindsberg - 08 Jun 2006 20:42 GMT
> Thanks Steve - stored in "lessons learned today" box!!!
I had my WWSD t-shirt on. On the back it says "What would Shyam do?" ;-)
OBTW, good call on the placeholders that can't have text frames. There's also
a bug in PPT97 - if you drag a picture into a text placeholder, the placeholder
when queried by VB says "Yes. I have a text frame." but errors when you ask
for the text.
> _____________________________
> John
[quoted text clipped - 21 lines]
> > PPTools: www.pptools.com
> > ================================================
-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
Geoff Cox - 09 Jun 2006 08:21 GMT
>Note that you can simplify this:
>
[quoted text clipped - 12 lines]
> ' the text has been colonized
>End If
Thanks to you Steve and everyone else!
Cheers
Geoff
>-----------------------------------------
>Steve Rindsberg, PPT MVP
>PPT FAQ: www.pptfaq.com
>PPTools: www.pptools.com
>================================================