none
PowerPoint picture placeholder events - How to detect a picture was changed? RRS feed

  • Question

  • Hi,

    Is there any way of detecting that a picture was changed on the slide in my C# PPT2010 add-in?

    Let's say I have a slide that contains a picture placeholder. I can detect when the placeholder has a picture added the first time by listening to the WindowSelectionChange event.

    Now let's say I right click on the picture and choose the "change picture" option. This time, when the new picture is added, the WindowSelectionChange is not fired.

    Is there some other event fired in this circumstance, or some way of inferring that the picture change has occured?

    thanks

    Thursday, March 22, 2012 4:16 PM

Answers

  • If you repurposed the the Insert Picture command you should be able to take a step in the right direction of knowing if they are "attempting" to change the picture.  You'd need to add the following to your add-ins ribbon xml and then write an onaction callback.

        <command idMso="PictureInsertFromFilePowerPoint" onAction="ClkInsertPic"/>


    Kind Regards, Rich ... http://greatcirclelearning.com

    Thursday, March 22, 2012 11:10 PM

All replies

  • If you repurposed the the Insert Picture command you should be able to take a step in the right direction of knowing if they are "attempting" to change the picture.  You'd need to add the following to your add-ins ribbon xml and then write an onaction callback.

        <command idMso="PictureInsertFromFilePowerPoint" onAction="ClkInsertPic"/>


    Kind Regards, Rich ... http://greatcirclelearning.com

    Thursday, March 22, 2012 11:10 PM
  • Hi Rich,

    Thanks for the pointer. I gave your idea a try and it was very helpful.

    I ended up repurposing the PictureChange command rather than the PictureInsertFromFilePowerPoint command.

    This provides an event for the picture change, but unfortunately the event is fired when the select file dialog is opened rather than when the picture actually changes.

    I'm going to play around a bit more, and see if i can figure out a way to infer that the picture change was applied by checking if the select file dialog closed.

    thanks

    Friday, March 23, 2012 10:45 AM