Powerpoint: Difference between revisions

From AutoIt Wiki
Jump to navigation Jump to search
Line 54: Line 54:
===== Object model =====
===== Object model =====
The Outlook object model is described [https://docs.microsoft.com/en-us/office/vba/api/overview/outlook/object-model here].
The Outlook object model is described [https://docs.microsoft.com/en-us/office/vba/api/overview/outlook/object-model here].
== Folders ==
It does not matter where an item is stored. You can access any folder and get/create/modify items there.
Folders you can access:
                               
{| style="border: 1px solid darkgray" cellspacing=0 cellpadding=5px
|-
! style="border: 1px solid darkgray" | Syntax
! style="border: 1px solid darkgray" | Folder you access
|-
| style="border: 1px solid darkgray" | "rootfolder\subfolder\...\subfolder"
| style="border: 1px solid darkgray" | any '''public folder''' or any folder of the current user (replace rootfolder with * to access the root folder of your mailbox)
|-
| style="border: 1px solid darkgray" | "\\rootfolder"
| style="border: 1px solid darkgray" | default folder of '''another user''' (class specified by $iOL_FolderType) (replace "rootfolder" with "*" to access your mailbox)
|-
| style="border: 1px solid darkgray" | "\\rootfolder\\subfolder\...\subfolder"
| style="border: 1px solid darkgray" | subfolder of the default folder of '''another user''' (class specified by $iOL_FolderType)
|-
| style="border: 1px solid darkgray" | "\\rootfolder\subfolder\..\subfolder"
| style="border: 1px solid darkgray" | subfolder of '''another user'''
|-
| style="border: 1px solid darkgray" | ""
| style="border: 1px solid darkgray" | default folder of the '''current user''' (class specified by $iOL_FolderType)
|-
| style="border: 1px solid darkgray" | "\subfolder"
| style="border: 1px solid darkgray" | subfolder of the default folder of the '''current user''' (class specified by $iOL_FolderType)
|}
'''Note:''' You need to use different formats to access '''public folders''' and the mailbox of '''other users'''!
"rootfolder" is one of the following:
* Mailbox name, e.g. "John.Doe@company.com"
* Display name, e.g. "John Doe"
For details please see the item specific section below.
=== Search folders ===
As of January 2018 the UDF supports Search Folders as well. Please have a look at functions _OL_SearchFolder*.


== Example Scripts ==
== Example Scripts ==

Revision as of 07:16, 1 August 2021

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