E
Evi
I have Powerpoint 97
I want my code to print all the text in text boxes in a file into the debug
window.
It works if the slide doesn't contain a .jpeg. If it does then I get the
error message
'TextFrame (Unknown member) invalid request. This type of shape cannot have
a TextRange'
But I thought that my code would test each shape and ignore those that don't
have text. What else can I do to eliminate these?
Evi
Here's the code:
Sub GetSlide()
'Copy the text from each file into the debug window
Dim SlideCount As Integer
Dim MyPres As Presentation
Dim Shp As Shape
Dim Sld As Slide
Dim TxtFrm As TextFrame
Dim AllSlides As Slides
Dim a As Integer
Dim b As Integer
Dim ShapeCount As Integer
Set MyPres = Application.ActivePresentation
For b = 1 To 30
'30 slides in presentation
Debug.Print b
Set Sld = MyPres.Slides(b)
ShapeCount = Sld.Shapes.Count
For a = 1 To ShapeCount
Set Shp = Sld.Shapes(a)
If Shp.HasTextFrame Then
If Shp.TextFrame.HasText Then
'why doesn't this bit reject the jpeg?
Debug.Print Shp.TextFrame.TextRange.Text
End If
End If
Next a
Next b
Set Sld = Nothing
Set Shp = Nothing
Set MyPres = Nothing
End Sub
I want my code to print all the text in text boxes in a file into the debug
window.
It works if the slide doesn't contain a .jpeg. If it does then I get the
error message
'TextFrame (Unknown member) invalid request. This type of shape cannot have
a TextRange'
But I thought that my code would test each shape and ignore those that don't
have text. What else can I do to eliminate these?
Evi
Here's the code:
Sub GetSlide()
'Copy the text from each file into the debug window
Dim SlideCount As Integer
Dim MyPres As Presentation
Dim Shp As Shape
Dim Sld As Slide
Dim TxtFrm As TextFrame
Dim AllSlides As Slides
Dim a As Integer
Dim b As Integer
Dim ShapeCount As Integer
Set MyPres = Application.ActivePresentation
For b = 1 To 30
'30 slides in presentation
Debug.Print b
Set Sld = MyPres.Slides(b)
ShapeCount = Sld.Shapes.Count
For a = 1 To ShapeCount
Set Shp = Sld.Shapes(a)
If Shp.HasTextFrame Then
If Shp.TextFrame.HasText Then
'why doesn't this bit reject the jpeg?
Debug.Print Shp.TextFrame.TextRange.Text
End If
End If
Next a
Next b
Set Sld = Nothing
Set Shp = Nothing
Set MyPres = Nothing
End Sub