I have written a C# WPF desktop application that uses the Microsoft PowerPoint 15.0 Object Library, and I want to be able to detect when any Slide is edited or modified. I was able to find a few events that I can latch onto, but it doesn't detect any pen tool annotations on the slide. So I guess my question is really two questions:
- Is there a PowerPoint API event that encompasses any and all Slide edits/modifications?
- Is there an event that can detect Pen ink strokes were added?
Here is a snippet of what I am able to do so far:
public void Initialize() { LogManager.Log(); // Create an instance of PowerPoint. this.powerpointApp = new Microsoft.Office.Interop.PowerPoint.Application(); // USED this.powerpointApp.WindowSelectionChange += this.WindowSelectionChange; this.powerpointApp.AfterPresentationOpen += this.AfterPresentationOpen; this.powerpointApp.SlideSelectionChanged += this.SlideSelectionChanged; this.powerpointApp.SlideShowNextSlide += this.SlideShowNextSlide; this.powerpointApp.PresentationNewSlide += this.PresentationNewSlide; this.powerpointApp.WindowActivate += this.WindowActivate; this.powerpointApp.AfterShapeSizeChange += this.AfterShapeSizeChange; } [DispId(2001)] private void WindowSelectionChange(Microsoft.Office.Interop.PowerPoint.Selection sel) { if (sel.Type == PpSelectionType.ppSelectionShapes || sel.Type == PpSelectionType.ppSelectionText) { // This condition means that you selected text or a shape within a slide. This can happen even when you write or create a new object // onto the slide. LogManager.Log(string.Format("sel is {0}", sel.GetType())); } else { LogManager.Log(string.Format("sel is {0}", sel.GetType())); } var displayText = sel.Type.ToString(); LogManager.Log(string.Format("PPT:{0}: sel.Type:{1}", System.Reflection.MethodBase.GetCurrentMethod().Name, displayText)); } private void AfterShapeSizeChange(Microsoft.Office.Interop.PowerPoint.Shape shp) { var slide = this.powerpointApp.ActivePresentation.Slides[1]; LogManager.Log(string.Format("PPT:AfterShapeSizeChange(...): SlideID:{0},Pres:{1}", slide.SlideID, slide.Application.ActivePresentation.Name)); this.refreshFilter.QueueRequest(slide); }
Any help would be greatly appreciated!
Tam Bui