VB Script
Edit|Remove
vbs
Dim pptApp
Dim fd
Dim vntSelectedItem
Set pptApp = CreateObject("PowerPoint.Application")
' Create a FileDialog object as a File Open dialog box.
Set fd = pptApp.FileDialog(3)
'/* To reference the FileDialog object .*/
With fd
.AllowMultiSelect = True
.Filters.Clear
.Filters.Add "All PowerPoint Presentations", "*.pptx,*.ppt,*.pptm,*.ppsx,*.pps,*.ppsm,*.potx,*.pot,*.potm,*.odp"
.Title = "Select Presentations to Operate"
'/* The user pressed the button .*/
If .Show = -1 Then
Dim myPPT
Dim strResult
Dim iNow
Dim iAll
Dim mySlide
Dim mySlides
iNow = 0
iAll = .SelectedItems.Count
'/* Step thru each string in the FileDialogSelectedItems collection. */
For Each vntSelectedItem In .SelectedItems
' To reference the opening presentation object.
Set myPPT = pptApp.Presentations.Open(vntSelectedItem, , , 0)
' Set the counter.
iNow = iNow + 1
' Display the progress.
WScript.Echo CStr(iNow) & "/" & CStr(iAll) & Chr(9) & myPPT.Name
With myPPT
Set mySlides = .Slides
'/* Step thru each slide. */
For Each mySlide In mySlides
If mySlide.NotesPage.Shapes.Count > 0 Then
mySlide.NotesPage.Shapes.Range.Delete
End If
Next
.Save
.Close
End With
Next
' Reminding for task completed in command line.
WScript.Echo Chr(10) & _
"*****************" & Chr(10) & _
" Task completed! " & Chr(10) & _
"*****************" & Chr(10)
'/* Set the object variable to nothing. */
Set myPPT = Nothing
Set mySlide = Nothing
Set mySlides = Nothing
End If
End With
' Set the object variable to nothing.
Set fd = Nothing
' Exit the created instance of PowerPoint application.
pptApp.Quit
Dim pptApp
Dim fd
Dim vntSelectedItem
Set pptApp = CreateObject("PowerPoint.Application")
' Create a FileDialog object as a File Open dialog box.
Set fd = pptApp.FileDialog(3)
'
With fd
.AllowMultiSelect = True
.Filters.Clear
.Filters.Add "All PowerPoint Presentations", "*.pptx,*.ppt,*.pptm,*.ppsx,*.pps,*.ppsm,*.potx,*.pot,*.potm,*.odp"
.Title = "Select Presentations to Operate"
'
If .Show = -1 Then
Dim myPPT
Dim strResult
Dim iNow
Dim iAll
Dim mySlide
Dim mySlides
iNow = 0
iAll = .SelectedItems.Count
'
For Each vntSelectedItem In .SelectedItems
' To reference the opening presentation object.
Set myPPT = pptApp.Presentations.Open(vntSelectedItem, , , 0)
' Set the counter.
iNow = iNow + 1
' Display the progress.
WScript.Echo CStr(iNow) & "/" & CStr(iAll) & Chr(9) & myPPT.Name
With myPPT
Set mySlides = .Slides
'
For Each mySlide In mySlides
If mySlide.NotesPage.Shapes.Count > 0 Then
mySlide.NotesPage.Shapes.Range.Delete
End If
Next
.Save
.Close
End With
Next
' Reminding for task completed in command line.
WScript.Echo Chr(10) & _
"*****************" & Chr(10) & _
" Task completed! " & Chr(10) & _
"*****************" & Chr(10)
'
Set myPPT = Nothing
Set mySlide = Nothing
Set mySlides = Nothing
End If
End With
' Set the object variable to nothing.
Set fd = Nothing
' Exit the created instance of PowerPoint application.
pptApp.Quit