This routine exports all Slide titles into a text file. It makes use of the HasTitle property to ascertain the existence of a title on the slide and then proceeds to locate the Title PlaceHolder. It prompts the user for a filename and then writes the title texts into it. If you find this routine useful you would be able to extend its functionality to copying the texts to the clipboard. 
' -------------------------------------------------------------------------------- ' Copyright ©1999-2007, Shyam Pillai, All Rights Reserved. ' -------------------------------------------------------------------------------- ' You are free to use this code within your own applications, add-ins, ' documents etc but you are expressly forbidden from selling or ' otherwise distributing this source code without prior consent. ' This includes both posting free demo projects made from this ' code as well as reproducing the code in text or html format. ' -------------------------------------------------------------------------------- Sub ExportSldTitles() ' Stores the filename provide by the user Dim strFileName As String ' Both I & J are used as counters Dim I As Integer Dim J As Integer ' Working on the active presentation. With ActivePresentation 'Display the input box with the default 'Titles.Txt' strFileName = InputBox("Enter a filename to export slide titles", _ "Provide filename...", "Titles.txt") 'Check if the user has pressed Cancel (Inputbox returns a zero length string) If strFileName = "" Then Exit Sub End If
' Do some good housekeeping and check for the existence of the file. ' Ask the user for further directions in case it does. : ) If Dir(.Path & "\" & strFileName) <> "" Then If MsgBox(strFileName & " already exists. Overwrite it?", _ vbQuestion + vbYesNo, "Warning") = vbNo Then Exit Sub End If End If
' Open the file for exporting the slide titles. File is created in the same folder as the open presentation. ' If the Presentation is a new one (No path) then it will get created in the Root Folder Open .Path & "\" & strFileName For Output As #1 For I = 1 To .Slides.Count
' Returns TRUE if there is a TitlePlaceholder If .Slides(I).Shapes.HasTitle Then ' Now loop thru the PlaceHolders and pick the text from the TitlePlaceHolder For J = 1 To .Slides(I).Shapes.Placeholders.Count With .Slides(I).Shapes.Placeholders.Item(J) If .PlaceholderFormat.Type = ppPlaceholderTitle Then ' Just inserted for debugging purposes... Debug.Print .TextFrame.TextRange ' Write the title text to the output file Print #1, .TextFrame.TextRange End If End With Next J End If Next I 'Close the open file Close #1 End With End Sub

|