Function Reference

_PPT_ErrorNotify

Sets or queries the debug level.

#Include <PowerPoint.au3>
_PPT_ErrorNotify($iDebug[, $sDebugFile = @ScriptDir & "\PowerPoint_Debug.txt"])

 

Parameters

$iDebug Debug level. Possible values are:
-1 - Return the current settings
0 - Disable debugging
1 - Enable debugging. Output the debug info to the console
2 - Enable Debugging. Output the debug info to a MsgBox
3 - Enable Debugging. Output the debug info to a file defined by $sDebugFile
4 - Enable Debugging. The COM errors will be handled (the script no longer crashes) without any output
$sDebugFile [optional] File to write the debugging info to if $iDebug = 3 (default = @ScriptDir & "\PowerPoint_Debug.txt")

 

Return Value

Success (for $iDebug => 0): 1, sets @extended to:
    0 - The COM error handler for this UDF was already active
    1 - A COM error handler has been initialized for this UDF
Success (for $iDebug =: 1) - one based one-dimensional array with the following elements:
    1 - Debug level. Value from 0 to 3. Check parameter $iDebug for details
    2 - Debug file. File to write the debugging info to as defined by parameter $sDebugFile
    3 - True if the COM error handler has been defined for this UDF. False if debugging is set off or a COM error handler was already defined
Failure: 0, sets @error to:
    1 - $iDebug is not an integer or < -1 or > 4
    2 - Installation of the custom error handler failed. @extended is set to the error code returned by ObjEvent
    3 - COM error handler already set to another function

 

Remarks

None.

 

Related

 

Example


#AutoIt3Wrapper_AU3Check_Parameters= -d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#AutoIt3Wrapper_AU3Check_Stop_OnWarning=Y
#include <Array.au3>
#include <PowerPoint.au3>
#include <MsgBoxConstants.au3>

; *************************
; Create application object
; *************************
Global $oPPT = _PPT_Open()
If @error Then Exit MsgBox($MB_ICONERROR, "PowerPoint Example Skript", "Function _PPT_Open encountered a problem. @error = " & @error & ", @extended = " & @extended)

; ************************************
; Example 1
; Set the debugging options to MsgBox.
; ************************************
_PPT_ErrorNotify(2)
If @error Then MsgBox($MB_ICONERROR, "PowerPoint Example Skript", "Function _PPT_ErrorNotify encountered a problem. @error = " & @error & ", @extended = " & @extended)
; Provoke a COM error
$oPPT.xyz

; ************************************************************
; Example 2
; Set the debugging option to file and set the filename.
; Query the debugging options and display the resulting array.
; ************************************************************
; Set the debugging options
_PPT_ErrorNotify(3, "C:\temp\PPT_Logging.txt")
If @error Then MsgBox(16, "PowerPoint Example Skript", "Function _PPT_ErrorNotify encountered a problem. @error = " & @error & ", @extended = " & @extended)
; Query the debugging options
Global $aResult = _PPT_ErrorNotify(-1)
If @error Then MsgBox(16, "PowerPoint Example Skript", "Function _PPT_ErrorNotify encountered a problem. @error = " & @error & ", @extended = " & @extended)
_ArrayDisplay($aResult)

; Close PowerPoint
_PPT_Close($oPPT)