I assume that this can be done with VBA but what parameters are used?
Any ideas
Steve
Something like this. It'll get unhappy if you have password protected presentations and a few
other oddities may upset it:
' Copy and paste this into a module then run ForEachPresentation:
Option Explicit
Public sMsg As String
Sub ForEachPresentation()
' Run a macro of your choosing on each presentation in a folder
Dim rayFileList() As String
Dim FolderPath As String
Dim FileSpec
Dim strTemp As String
Dim x As Long
Dim iFileNum As Integer
Dim sFileName As String
' EDIT THESE to suit your situation
FolderPath = "q:\@support\" ' Note: MUST end in \
FileSpec = "*.ppt"
sFileName = "C:\Temp\List.txt" ' FULL path to the output file
' END OF EDITS
' Fill the array with files that meet the spec above
ReDim rayFileList(1 To 1) As String
strTemp = Dir$(FolderPath & FileSpec)
While strTemp <> ""
Select Case UCase(Right$(strTemp, 4))
Case Is = "PPTX", "PPTM", "PPSX"
' ignore it
Case Is = ".PPT"
rayFileList(UBound(rayFileList)) = FolderPath & strTemp
ReDim Preserve rayFileList(1 To UBound(rayFileList) + 1) As String
End Select
strTemp = Dir
Wend
' array has one blank element at end - don't process it
' don't do anything if there's less than one element
If UBound(rayFileList) > 1 Then
For x = 1 To UBound(rayFileList) - 1
Call MyMacro(rayFileList(x))
Next x
End If
iFileNum = FreeFile
Open sFileName For Output As iFileNum
Print #iFileNum, sMsg
Close iFileNum
End Sub
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
Dim oPresentation As Presentation
On Error Resume Next
Set oPresentation = Presentations.Open(strMyFile)
With oPresentation
sMsg = .FullName & vbTab & .TemplateName & vbTab & .BuiltInDocumentProperties("Last
Author") & vbCrLf
.Close
End With
End Sub
==============================
PPT Frequently Asked Questions
http://www.pptfaq.com/
PPTools add-ins for PowerPoint
http://www.pptools.com/