Try the code below. It works in my test, using Microsoft Office 2003
and IronPython 2.
import time
import clr
from System.Runtime.InteropServices import Marshal
clr.AddReference("Microsoft.Office.Interop.PowerPoint")
import Microsoft.Office.Interop.PowerPoint as PowerPoint
def onWindowSelectionChange(selection):
print "Window selection changed."
if __name__ == "__main__":
ppt = Marshal.GetActiveObject("PowerPoint.Application")
ppt.WindowSelectionChange += onWindowSelectionChange
while True:
time.sleep(1)
_______________________________________________
Users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com