Good morning. I haven't seen any code to do this so I've started my own but even having just started it looks a bit clunky. I've created an array of words that will appear on each slide and make up part of each line of contents, called "TitleNames". I was thinking of building another array that corresponds the word to the slide number and then trying to build up some sort of TOC from there on slide 2. Is there any way to avoid 'Selecting' each slide in order to examine its contents?
Am I barking up the wrong tree?
Many thanks,
D€$
Code:
For x = 3 To 11
ActivePresentation.Slides.Range("Slide " & x).Select
Set oSld = ActivePresentation.Slides(Application.ActiveWindow.Selection.SlideRange.SlideIndex)
For Each TitleName In TitleNames
Set MyText = oSld.Shapes("TextBox Title") 'Each slide has a text box called "TextBox Title"
If InStr(MyText.TextFrame.TextRange, TitleName) Then 'The heading has been found in the 'Title'
b = x 'Slide Number '(This was just testing as I built up the code)
Contents(x - 3) = TitleName 'New Array of found Titles
Exit For 'Heading has been found in the Title
End If
Next TitleName
Next x 'Slide number
Am I barking up the wrong tree?
Many thanks,
D€$