Function Reference

_PPT_PresentationList

Returns a list of currently open presentations.

#Include <PowerPoint.au3>
_PPT_PresentationList($oPPT)

 

Parameters

$oPPT PowerPoint application object to retrieve the list of presentations from

 

Return Value

Success: a two-dimensional zero based array with the following information:
    0 - Object of the presentation
    1 - Name of the presentation/file
    2 - Complete path to the presentation/file
    3 - Title of the presentation derived from the first window.caption of the presentation
Failure: 0 and sets @error.
    1 - $oPPT is not an object or not an application object

 

Remarks

None.

 

Related

_PPT_SlideList, _PPT_ShapeList

 

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>
#include <Array.au3>

; *************************
; Create application object
; *************************
Global $oPPT = _PPT_Open()
If @error Then Exit MsgBox($MB_ICONERROR, "PowerPoint UDF: _PPT_PresentationList Example", "Error creating the PowerPoint application object." & @CRLF & "@error = " & @error & ", @extended = " & @extended)

; **********************
; Open two presentations
; **********************
Global $sPresentation = @ScriptDir & "\Presentation1.pptx"
Global $oPresentation1 = _PPT_PresentationOpen($oPPT, $sPresentation, True)
If @error Then Exit MsgBox($MB_ICONERROR, "PowerPoint UDF: _PPT_PresentationList Example", "Error opening presentation '" & $sPresentation & "'." & @CRLF & "@error = " & @error & ", @extended = " & @extended)

$sPresentation = @ScriptDir & "\Presentation2.pptx"
Global $oPresentation2 = _PPT_PresentationOpen($oPPT, $sPresentation, True)
If @error Then Exit MsgBox($MB_ICONERROR, "PowerPoint UDF: _PPT_PresentationList Example", "Error opening presentation '" & $sPresentation & "'." & @CRLF & "@error = " & @error & ", @extended = " & @extended)

; ****************************************
; Display a list of all open presentations
; ****************************************
Global $aPresentations = _PPT_PresentationList($oPPT)
If @error Then Exit MsgBox($MB_ICONERROR, "PowerPoint UDF: _PPT_PresentationList Example 1", "Error listing Presentationss." & @CRLF & "@error = " & @error & ", @extended = " & @extended)
_ArrayDisplay($aPresentations, "PowerPoint UDF: _PPT_PresentationList Example 1 - List of all open Presentations")