Delete one or multiple slides from a presentation.
#Include <PowerPoint.au3>
_PPT_SlideDelete($oPresentation, $vSlide)
Parameters
$oPresentation | Presentation object. |
$vSlide | Slide or Slides to delete. Format of this parameter is described in _PPT_SlideRangeSet. |
Return Value
Success: 1.
Remarks
None.
Related
Example
#AutoIt3Wrapper_AU3Check_Parameters= -d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#AutoIt3Wrapper_AU3Check_Stop_OnWarning=N
#include <PowerPoint.au3>
#include <MsgBoxConstants.au3>
; *************************************************
; Create application object and open a presentation
; *************************************************
Global $oPPT = _PPT_Open()
If @error Then Exit MsgBox($MB_ICONERROR, "PowerPoint UDF: _PPT_SlideDelete Example", "Error creating the PowerPoint application object." & @CRLF & "@error = " & @error & ", @extended = " & @extended)
; Open presentation 1
Global $sPresentation = @ScriptDir & "\Presentation1.pptx"
Global $oPresentation1 = _PPT_PresentationOpen($oPPT, $sPresentation)
If @error Then
MsgBox($MB_ICONERROR, "PowerPoint UDF: _PPT_SlideDelete Example", "Error opening presentation '" & $sPresentation & "'." & @CRLF & "@error = " & @error & ", @extended = " & @extended)
_PPT_Close($oPPT)
Exit
EndIf
; *******************************************
; Delete slides 1 and 2 from the presentation
; *******************************************
_PPT_SlideDelete($oPresentation1, "1,2")
If @error Then Exit MsgBox($MB_ICONERROR, "PowerPoint UDF: _PPT_SlideDelete Example 1", "Error deleting slides." & @CRLF & "@error = " & @error & ", @extended = " & @extended)
MsgBox($MB_ICONINFORMATION, "PowerPoint UDF: _PPT_SlideDelete Example 1", "Slides 1 and 2 deleted.")