Powerpoint

From AutoIt Wiki
Revision as of 07:16, 1 August 2021 by Water (talk | contribs) (→‎Folders)
Jump to navigation Jump to search

This page is still a work in progress.

The PowerPoint UDF offers basic functions to control and manipulate Microsoft PowerPoint.

Concepts

UDF

The PowerPoint UDF is based on the following concept:

  • _PPT_Open
  • Some functions allow to process just a single Slide and others allow a range of Slides.
    The the description of the specific function.
  • Some functions allow to process just a single Shape and others allow a range of Shapes.
    The the description of the specific function.
  • _PPT_Close

PowerPoint

Terms
  • An event is an activity that lasts 24 hours or longer.
  • An appointment is an activity that does not involve reserving resources or inviting other people.
  • A meeting is an appointment for which you reserve a period of time, invite people to, or reserve resources.

A more detailed description of this terms can be found here.

Concepts

You can get an overview of the concepts of PowerPoint on this website.

Events

PowerPoint provides a wide range of events through which it can notify your script that a significant change has occurred. For example, PowerPoint events can notify your script when you start a slide show..
To receive notification of a significant event, write an event-handler procedure. This is a function that PowerPoint calls when the event is called. The code you put in the event handler allows your program to respond appropriately to the event and, in some cases, even lets your program cancel the default action associated with the event.

Responding to Events
The following example (reduced to the minimum) shows how to handle events:

Global $oOL = _OL_Open()
Global $oTemp = ObjEvent($oOL, "oOL_") ; Create the application-level event handler 
While 1
	Sleep(10)
WEnd
Func oOL_NewMailEx($sEntryIDs)
	Local $iItemCount, $oItem
	Local $aEntryIDs = StringSplit($sEntryIDs, ",", $STR_NOCOUNT) ; multiple EntryIDs are separated by ,
	$iItemCount = UBound($aEntryIDs)
	ConsoleWrite("OutlookEX UDF Example Script - " & ($iItemCount = 1 ? "new item has" : "new items have") & " arrived!" & @CRLF & @CRLF)
	For $i = 0 To $iItemCount - 1
		$oItem = $oOL.Session.GetItemFromID($aEntryIDs[$i], Default) ; Translate the EntryID string to the item object
		ConsoleWrite("From:    " & $oItem.SenderName & @CRLF & "Subject: " & $oItem.Subject & @CRLF & "Class:   " & $oItem.Class & " (43=Mail, 53=MeetingRequest ...)" & @CRLF)
	Next
EndFunc

More examples come with the UDF.

Object model

The Outlook object model is described here.

Example Scripts

For single functions

Every function of the UDF comes with an example script (except internal functions). The example script is named like the function.

Extended Examples

Example scripts which describe more than a single function of the UDF are prefixed with _PPT_Example_.

Function specific pages

The following pages contain information for the functions that can be used for many different item types.

Find an Item

Further information on how to find items: OutlookEX UDF - Find Items

Forward an Item

Further information on how to forward items: OutlookEX UDF - Forward Items