<div>There&#39;s a reference for the TextRange object at <a href="http://msdn.microsoft.com/en-us/library/bb251500.aspx">http://msdn.microsoft.com/en-us/library/bb251500.aspx</a>.&nbsp; It doesn&#39;t look like it supports any events.&nbsp; From what I can tell, all the events for PowerPoint are defined on the Application object: <a href="http://msdn.microsoft.com/en-us/library/bb251405.aspx">http://msdn.microsoft.com/en-us/library/bb251405.aspx</a>.&nbsp; Perhaps the WindowSelectionChange event will do what you want.</div>

<div><br>&nbsp;</div>
<div class="gmail_quote">On Tue, Jun 24, 2008 at 4:51 PM, Julien Sylvestre &lt;<a href="mailto:jusylves@videotron.ca">jusylves@videotron.ca</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hello,<br>&nbsp;I&#39;m new at Ironpython, I&#39;ve been looking at a way to interact dynamically with PowerPoint.<br>
<br>I got some simple code to work to access the text in a box which is selected in PowerPoint:<br><br>import clr<br>from System.Runtime.InteropServices import Marshal<br>clr.AddReference(&quot;Microsoft.Office.Interop.PowerPoint&quot;)<br>
import Microsoft.Office.Interop.PowerPoint as PowerPoint<br>ppt = Marshal.GetActiveObject(&quot;PowerPoint.Application&quot;)<br>sel = ppt.ActiveWindow.Selection.TextRange<br>print sel.Text<br><br>This is nice, because if I change the text that was initially selected in PowerPoint, and do &quot;print sel.Text&quot; again, I get the updated text in Python (i.e., I get a reference to the TextRange object, which I can interogate with the Text method when changes are made in PowerPoint).<br>
<br>My question is: is there a way to register an event handler to do some action automatically when the text is modified in PowerPoint? Ideally, I&#39;d like my Python script to execute some actions whenever the TextRange object is modified in PowerPoint. If that&#39;s not feasible, I could also run those actions when the user does something particular (like changing his selection, or saving his PPT file).<br>
<br>I&#39;ve been trying to introspect my Python objects, but couldn&#39;t locate anything that would allow me to setup my event handler.<br><br>Any comment or suggestion would be greatly appreciated.<br><br>Thanks,<br>Julien.<br>
_______________________________________________<br>Users mailing list<br><a href="mailto:Users@lists.ironpython.com" target="_blank">Users@lists.ironpython.com</a><br><a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br>
</blockquote></div><br>