Print one/multiple/all slides of a presentation.
#Include <PowerPoint.au3>
_PPT_PresentationPrint($oPresentation[, $iStartingSlide = 1[, $iEndingSlide = Default[, $iCopies = 1[, $sPrinter = Default]]]])
Parameters
$oPresentation | Presentation object. |
$iStartingSlide | [optional] Number of the first slide to be printed (default = 1). |
$iEndingSlide | [optional] Number of the last slide to be printed (default = keyword Default = last slide of the presentation). |
$iCopies | [optional] Number of copies to be printer (default = 1). |
$sPrinter | [optional] Sets the name of the printer (default = keyword Default = Active printer) |
Return Value
Success: 1.
Remarks
Method PrintOut only supports a single range of consecutive slides.
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 an example presentation
; **********************************************************
Global $sPresentation = @ScriptDir & "\Presentation1.pptx"
Global $oPPT = _PPT_Open()
If @error Then Exit MsgBox($MB_ICONERROR, "PowerPoint UDF: _PPT_PresentationPrint Example", "Error creating the PowerPoint application object." & @CRLF & "@error = " & @error & ", @extended = " & @extended)
Global $oPresentation = _PPT_PresentationOpen($oPPT, $sPresentation)
If @error Then
MsgBox($MB_ICONERROR, "PowerPoint UDF: _PPT_PresentationPrint Example", "Error opening presentation '" & $sPresentation & "'." & @CRLF & "@error = " & @error & ", @extended = " & @extended)
_PPT_Close($oPPT)
Exit
EndIf
; ****************************************
; Print slides 2 and 3 of the presentation
; ****************************************
_PPT_PresentationPrint($oPresentation, 2, 3)
If @error Then Exit MsgBox($MB_ICONERROR, "PowerPoint UDF: _PPT_PresentationPrint Example 1", "Error printing '" & $sPresentation & "'." & @CRLF & "@error = " & @error & ", @extended = " & @extended)
MsgBox($MB_ICONINFORMATION, "PowerPoint UDF: _PPT_PresentationPrint Example 1", "Presentation '" & $sPresentation & "' successfully printed.")