Sorting slides by title into alphabetical order

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a large presentation. I would like to sort the slides by title into
alphabetical order. I don't want to manually shuffle them around in the sort
slide view, is there a way to do that? Thanks!
 
Stephanie,
Sorry, I do not believe that there is a built-in way to do this.
Maybe something can be accomplished with VBA, or with an add-in, haven't
found one yet though.
Luc
 
Speaking of VBA macros (we were, weren't we?)

For help understanding where this goes (should you be unfamiliar with macros
or VBA)
**How do I use VBA code in PowerPoint?
http://www.rdpslides.com/pptfaq/FAQ00033.htm


===== Begin Code =====
Sub bbbelu_orst()
'Set up some variables
Dim SldNum As Integer
Dim ChngFlag As Boolean
Dim NumRuns As Integer
ChngFlag = False

'just because I'm lazy
With ActivePresentation

'I need a place to come back to
LoopBack:

'Loop thru all the slides except the last one. _
We'll compare it to the slide that follows, _
so the last one will not need to be evaluated.
For SldNum = 1 To .Slides.Count - 1
'Check if both the slides have a title
If .Slides(SldNum).Shapes.Has = msoTrue And _
.Slides(SldNum + 1).Shapes.Has = msoTrue Then

'Check which comes first (it was the egg)
If CStr(.Slides(SldNum).Shapes.Placeholders(1) _
.TextFrame.TextRange.Text) > _
CStr(.Slides(SldNum + 1).Shapes.Placeholders(1) _
.TextFrame.TextRange.Text) Then
'Mark that I did something
ChngFlag = True
'reverse the slides
.Slides(SldNum + 1).MoveTo SldNum
End If
End If

'If there is no title, then move it towards the beginning, _
because nothing comes before something
If .Slides(SldNum + 1).Shapes.Has = msoFalse Then
.Slides(SldNum + 1).MoveTo SldNum
End If
Next SldNum
NumRuns = NumRuns + 1

'If I'm not done by now, maybe you don't want me to go on.
If NumRuns > 1000 Then
If MsgBox("Extended duration. Continue?", _
vbYesNo) <> vbYes Then Exit Sub
NumRuns = 0
End If

'If nothing was changed, don't do it again
If ChngFlag = True Then
ChngFlag = False
GoTo LoopBack
End If

'Big finish
End With
MsgBox "Done."

End Sub
===== End Code =====



--
Bill Dilworth
A proud member of the Microsoft PPT MVP Team
Users helping fellow users.
billdilworth.mvps.org
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
yahoo2@ Please read the PowerPoint
yahoo. FAQ pages. They answer most
com of our questions.
www.pptfaq.com
..
..
 
Sorry, the evil spell (checker) fixed code that wasn't broken. The .Has
should be .HasTitle ...

'Check if both the slides have a title
If .Slides(SldNum).Shapes.HasTitle = msoTrue And _
.Slides(SldNum + 1).Shapes.HasTitle = msoTrue Then

'Check which comes first (it was the egg)
If CStr(.Slides(SldNum).Shapes.Placeholders(1) _
.TextFrame.TextRange.Text) > _
CStr(.Slides(SldNum + 1).Shapes.Placeholders(1) _
.TextFrame.TextRange.Text) Then
'Mark that I did something
ChngFlag = True
'reverse the slides
.Slides(SldNum + 1).MoveTo SldNum
End If
End If

'If there is no title, then move it towards the beginning, _
because nothing comes before something
If .Slides(SldNum + 1).Shapes.HasTitle = msoFalse Then
.Slides(SldNum + 1).MoveTo SldNum
End If
 
'Check if both the slides have a title
If .Slides(SldNum).Shapes.Has = msoTrue And _
.Slides(SldNum + 1).Shapes.Has = msoTrue Then


.Shapes.Has ' ?
.Shapes.HasTitle ' better?
 
Back
Top