Function Reference

_PPT_ShapeList

Returns a list of shapes in a slide.

#Include <PowerPoint.au3>
_PPT_ShapeList($oPresentation, $vSlide)

 

Parameters

$oPresentation Presentation object to be saved.
$vSlide Slide for which to list the shapes. The SlideRange object will be created from this Slide.

 

Return Value

Success: a two-dimensional zero based array with the following information:
    0 - Object of the Shape
    1 - Property ID: Number that identifies the shape
    2 - Property Name: Name created by PowerPoint or the user
    3 - Property Type: Type of the Shape
    4 - Property Visible: visibility of the Shape
    5 - Property ZOrderPosition: position of the shape in the z-order
    6 - Property HasTextFrame: Returns whether the shape has a text frame and can therefore contain text
    7 - Property HasTable: Returns whether the shape is a table
Failure: 0 and sets @error.
    1 - $oPresentation is not an object or not a presentation object
    2 - Error occurred creating the SlideRange from $vSlides. @extended is set to the error code returned by _PPT_SlideRangeSet

 

Remarks

The function only processes the first Slide if parameter $vSlide returns more than one Slide

 

Related

_PPT_PresentationList, _PPT_SlideList

 

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_ShapeList Example", "Error creating the PowerPoint application object." & @CRLF & "@error = " & @error & ", @extended = " & @extended)

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

; ***********************************
; Display a list of shapes on slide 1
; ***********************************
Global $aShapes = _PPT_ShapeList($oPresentation, 1)
If @error Then Exit MsgBox($MB_ICONERROR, "PowerPoint UDF: _PPT_ShapeList Example 1", "Error listing Shapes for Slide 1." & @CRLF & "@error = " & @error & ", @extended = " & @extended)
_ArrayDisplay($aShapes, "PowerPoint UDF: _PPT_ShapeList Example 1 - List of Shapes on Slide 1")