Function Reference

_PPT_TableGet

Read data from a PowerPoint Table Shape to an Array.

#Include <PowerPoint.au3>
_PPT_TableGet($oPresentation, $vSlide[, $vShape = 0])

 

Parameters

$oPresentation Object of the presentation to process.
$vSlide Slide to process.
$vShape Shape to process on $vSlide. See Remarks.

 

Return Value

Success: A two-dimensional zero based array holding the values of the Table Shape.
Failure: "" and sets @error.
    1 - $oPresentation is not an object or not a presentation object
    2 - Specified Shape is not a Table Shape or no Table Shape could be found

 

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

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

; *****************************************************************************
; Create a new presentation and add 3 slides (including title slide)
; *****************************************************************************
Global $oPresentation = _PPT_PresentationNew($oPPT)
If @error Then Exit MsgBox($MB_ICONERROR, "PowerPoint UDF: _PPT_TableGet Example 1", "Error creating new presentation." & @CRLF & "@error = " & @error & ", @extended = " & @extended)

_PPT_SlideAdd($oPresentation, 1, 3)
If @error Then Exit MsgBox($MB_ICONERROR, "PowerPoint UDF: _PPT_TableGet Example 1", "Error adding slides to the presentation." & @CRLF & "@error = " & @error & ", @extended = " & @extended)

; *****************************************************************************
; Example 1
; Add a Table Shape to Slide 2, search for the first Table Shape and write
; the array to this Shape.
; Retrieve and display the data from the first Table Shape on Slide 2.
; *****************************************************************************
Global $aData[][] = [["DataTable1", "Col1", "Col2", "Col3", "Col4", "Col5"], ["Row1", 11, 21, 31, 41, 51], ["Row2", 12, 22, 32, 42, 52], ["Row3", 13, 23, 33, 43, 53], ["Row4", 14, 24, 34, 44, 54]]
Global $aTableShape = _PPT_ShapeAdd($oPresentation, 2, $MsoTable, Default, Default, Default, Default, 3, 4)
If @error Then Exit MsgBox($MB_ICONERROR, "PowerPoint UDF: _PPT_TableGet Example 1", "Error adding Table Shape!" & @CRLF & "@error = " & @error & ", @extended = " & @extended)

_PPT_TableSet($oPresentation, 2, 0, $aData)
If @error Then Exit MsgBox($MB_ICONERROR, "PowerPoint UDF: _PPT_TableGet Example 1", "Error adding data to the Table Shape!" & @CRLF & "@error = " & @error & ", @extended = " & @extended)

Global $aTableData = _PPT_TableGet($oPresentation, 2)
If @error Then Exit MsgBox($MB_ICONERROR, "PowerPoint UDF: _PPT_TableGet Example 1", "Error retrieving data from the Table Shape!" & @CRLF & "@error = " & @error & ", @extended = " & @extended)
_ArrayDisplay($aTableData)