Opens an existing presentation.
#Include <PowerPoint.au3>
_PPT_PresentationOpen($oPPT, $sFilePath[, $bReadOnly = False[, $bVisible = True]])
Parameters
$oPPT | PowerPoint application object where you want to open the presentation |
$sFilePath | Path and filename of the file to be opened. |
$bReadOnly | [optional] True opens the presentation as read-only (default = False). |
$bVisible | [optional] True specifies that the presentation window will be visible (default = True). |
Return Value
Success: a presentation object. @extended is set to 1 if $bReadOnly = False but read-write access could not be granted. Please see the Remarks section for details.
Remarks
When you set $bReadOnly = False but the presentation can't be opened read-write @extended is set to 1.
Related
_PPT_PresentationAttach, _PPT_PresentationClose, _PPT_PresentationNew
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
; *************************
Global $oPPT = _PPT_Open()
If @error Then Exit MsgBox($MB_ICONERROR, "PowerPoint UDF: _PPT_PresentationOpen Example", "Error creating the PowerPoint application object." & @CRLF & "@error = " & @error & ", @extended = " & @extended)
; **************************************
; Open an existing presentation readonly
;***************************************
Global $sPresentation = @ScriptDir & "\Presentation1.pptx"
Global $oPresentation = _PPT_PresentationOpen($oPPT, $sPresentation, True)
If @error Then Exit MsgBox($MB_ICONERROR, "PowerPoint UDF: _PPT_PresentationOpen Example", "Error opening presentation '" & $sPresentation & "'." & @CRLF & "@error = " & @error & ", @extended = " & @extended)
MsgBox($MB_ICONINFORMATION, "PowerPoint UDF: _PPT_PresentationOpen Example 1", "Presentation '" & $sPresentation & "' successfully opened readonly.")