M
Mike Frith
Hi,
I have the following code that cycles through the slides, finds all the
textboxes on each slide and tries to get the first four characters of text.
But the error I get is "Invalid qualifier" on the line indicated below and
"theText" is highlighted. I'm sure it's something simple but I have no idea.
Can anyone clue me in?
thanks
Mike
Sub SaveData()
Dim theDirectory As Presentation
Set theDirectory = Application.Presentations(1)
Dim theSlides As Slides
Set theSlides = theDirectory.Slides
Dim slideCount As Long
slideCount = theSlides.Count()
Dim strClub As String
Dim theText As String
Dim strLength As Long
For i = 1 To slideCount
Dim shapeCount As Long
shapeCount = theSlides(i).shapes.Count
For j = 1 To shapeCount
If theSlides(i).shapes(j).Type = msoTextBox Then
theText = theSlides(i).shapes(j).TextFrame.TextRange.Text
If theText.Left(4) = "Club" Then <----------- error here
strClub = theText.Left(4)
End If
Next j
Next i
End Sub
I have the following code that cycles through the slides, finds all the
textboxes on each slide and tries to get the first four characters of text.
But the error I get is "Invalid qualifier" on the line indicated below and
"theText" is highlighted. I'm sure it's something simple but I have no idea.
Can anyone clue me in?
thanks
Mike
Sub SaveData()
Dim theDirectory As Presentation
Set theDirectory = Application.Presentations(1)
Dim theSlides As Slides
Set theSlides = theDirectory.Slides
Dim slideCount As Long
slideCount = theSlides.Count()
Dim strClub As String
Dim theText As String
Dim strLength As Long
For i = 1 To slideCount
Dim shapeCount As Long
shapeCount = theSlides(i).shapes.Count
For j = 1 To shapeCount
If theSlides(i).shapes(j).Type = msoTextBox Then
theText = theSlides(i).shapes(j).TextFrame.TextRange.Text
If theText.Left(4) = "Club" Then <----------- error here
strClub = theText.Left(4)
End If
Next j
Next i
End Sub