Hi,
I think this is a relevant code sample from PowerPoint 2004 help:
CommandBarEvents Property Example
The following example uses code including the CommandBarEvents property to
support any code to handle a mouse click on a command bar.
Private WithEvents ce As CommandBarEvents
Sub Test()
Dim c As CommandBarControl
Set c = Application.VBE.CommandBars("Tools").Controls(1)
Set ce = Application.VBE.Events.CommandBarEvents(c)
End Sub
Private Sub ce_Click(ByVal CommandBarControl As Object, Handled As Boolean,
_
CancelDefault As Boolean)
' Put event-handling code here
End Sub
----
The office object model is accessible to AppleScript. It is also available
to any 3rd part application that uses OLE Automation, such as RealBasic.
----
More from PowerPoint help:
When an application supports Automation, the objects the application exposes
can be accessed by Visual Basic. Use Visual Basic to manipulate these
objects by invoking methods on the object or by getting and setting the
object's properties. For example, you can create an Automation object named
MyObj and write the following code to access the object:
MyObj.Insert "Hello, world." ' Place text.
MyObj.Bold = True ' Format text.
#If Mac Then ' Check your platform constant
MyObj.SaveAs "Macintosh HD:Applications:Users:Shared:TESTOBJ.DOC" '
Save the object (Macintosh).
#Else
MyObj.SaveAs "C:\WORDPROC\DOCS\TESTOBJ.DOC" ' Save the object
(Windows).
#End If
Use the following functions to access an Automation object:
Function Description
CreateObject Creates a new object of a specified type.
GetObject Retrieves an object from a file.
When an application supports Automation, the objects the application exposes
can be accessed by Visual Basic. Use Visual Basic to manipulate these
objects by invoking methods on the object or by getting and setting the
object's properties. For example, you can create an Automation object named
MyObj and write the following code to access the object:
MyObj.Insert "Hello, world." ' Place text.
MyObj.Bold = True ' Format text.
#If Mac Then ' Check your platform constant
MyObj.SaveAs "Macintosh HD:Applications:Users:Shared:TESTOBJ.DOC" '
Save the object (Macintosh).
#Else
MyObj.SaveAs "C:\WORDPROC\DOCS\TESTOBJ.DOC" ' Save the object
(Windows).
#End If
Use the following functions to access an Automation object:
Function Description
CreateObject Creates a new object of a specified type.
GetObject Retrieves an object from a file.
----
Although the visual basic editor and the visual basic compiler will be
removed from Microsoft Office, it is possible that the OLE Automation will
not die because OLE automation does not need the VBA compiler. If you were
to use RealBasic your code is compiled by and in RealBasic, not VBA even
though RealBasic uses VBA OLE animation syntax to run VBA code. It would be
almost the same as running PowerPoint from Word or Excel today in 2004's
Visual Basic environment.
The upside to this is the when you make a RealBasic compiled application to
run PowerPoint on the Mac, if you're careful your code should work on the PC
side, too. There are differences in the Mac and Windows office object
models, and you will have to take those into account when using OLE
Automation just as you would in the visual basic editor.
-Jim Gordon
Mac MVP
Not using VBA, I'm afraid. PPT's VBA implementation doesn't get events until
VBA version 6, but Mac Office is still on VBA version 5. No events in PPT,
and
the next version won't even have VBA.
PPT may expose different methods/properties/events to Applescript than to VBA;
if so, that might be the answer. Poke around this and other newsgroups in the
neighborhood and see if you can turn up Paul Berkowitz. If anyone knows, he
would.
================================================
Steve Rindsberg, PPT MVP
PPT FAQ:
www.pptfaq.com
PPTools:
www.pptools.com
================================================
--
Jim Gordon
Mac MVP
MVPs are not Microsoft Employees
MVP info