G
Geoff Cox
Hello,
I am trying to search multiple ppt files to find a few cases where
there is a colon in a text placeholder (type 14). I would like to be
able to view the slides which have the colon.
Can anyone please point me at macro code which tackles this kind of
action?
The code below will find an action button on any slide - perhaps this
could be changed to find the colon??
I am not clear how the
If .Shapes.Count > 0 Then
would be changed to cope with looking for a colon within a text
placeholder ....
Thanks
Geoff
Sub MyMacro(strMyFile As String)
' this gets called once for each file that meets the spec you enter in
ForEachPresentation
' strMyFile is set to the file name each time
' Probably at a minimum, you'd want to:
Dim oPresentation As Presentation
Set oPresentation = Presentations.Open(strMyFile)
With oPresentation
Dim oSh As shape
Dim bFoundButton As Boolean
Dim bFoundRectangle As Boolean
bFoundButton = False ' to start
With ActivePresentation.Slides(ActivePresentation.Slides.Count)
If .Shapes.Count > 0 Then
For Each oSh In _
ActivePresentation.Slides(ActivePresentation.Slides.Count) _
.Shapes
If oSh.Type = 1 Then
If oSh.AutoShapeType = 130 Then
bFoundButton = True
End If
End If
Next
' Now display a message
' If bFoundButton Then
' MsgBox "Found a Forward or Next button on the last slide"
'Else
' MsgBox "No Forward/Next buttons here"
'End If
If Not bFoundButton Then
MsgBox "No button on last slide of " & strMyFile
End If
Else
MsgBox "No shape on this last slide in " & strMyFile
End If
End With
oPresentation.Close
End With
Set oSh = Nothing
Set oPresentation = Nothing
End Sub
I am trying to search multiple ppt files to find a few cases where
there is a colon in a text placeholder (type 14). I would like to be
able to view the slides which have the colon.
Can anyone please point me at macro code which tackles this kind of
action?
The code below will find an action button on any slide - perhaps this
could be changed to find the colon??
I am not clear how the
If .Shapes.Count > 0 Then
would be changed to cope with looking for a colon within a text
placeholder ....
Thanks
Geoff
Sub MyMacro(strMyFile As String)
' this gets called once for each file that meets the spec you enter in
ForEachPresentation
' strMyFile is set to the file name each time
' Probably at a minimum, you'd want to:
Dim oPresentation As Presentation
Set oPresentation = Presentations.Open(strMyFile)
With oPresentation
Dim oSh As shape
Dim bFoundButton As Boolean
Dim bFoundRectangle As Boolean
bFoundButton = False ' to start
With ActivePresentation.Slides(ActivePresentation.Slides.Count)
If .Shapes.Count > 0 Then
For Each oSh In _
ActivePresentation.Slides(ActivePresentation.Slides.Count) _
.Shapes
If oSh.Type = 1 Then
If oSh.AutoShapeType = 130 Then
bFoundButton = True
End If
End If
Next
' Now display a message
' If bFoundButton Then
' MsgBox "Found a Forward or Next button on the last slide"
'Else
' MsgBox "No Forward/Next buttons here"
'End If
If Not bFoundButton Then
MsgBox "No button on last slide of " & strMyFile
End If
Else
MsgBox "No shape on this last slide in " & strMyFile
End If
End With
oPresentation.Close
End With
Set oSh = Nothing
Set oPresentation = Nothing
End Sub