How can I add a shape with a special behavior to a PP slide?

A

Avivit Bercovici

Hi All,
[Sorry for the length, please bear with me]

I'm writing an Addin for PP2007 using VS2008.
I'd like to add a shape with special behavior to a PP slide:
- when you delete the shape, it triggers an event in my PP addin,
- when you copy and paste the shape it triggers an event in my PP
- when you double click on it a context ribbon is shown.
- the user will not be able to change the shape's location.
- it's appearance can be changed by choosing from the context ribbon

I am reviewing several possible solutions:
A. Use:
slide.Shapes.AddShape(Microsoft.Office.Core.MsoAutoShapeType.msoShapeActionButtonCustom, 88, 100, 10, 10);
However the ActionButton is only active in presentation mode, I need this
functionality to be active when not in presentation mode too.

B. Using SmartArt - will only be possible in 2010
(http://www.eggheadcafe.com/community/aspnet/68/10123496/adding-a-custom-smartart.aspx).

C. Use a control from Window's forms. Problem is that It can't be added to a
slide.

D. [looks like my last hope] use the slide.Shapes.AddOLEObject method. This
approach means I need to write the OLE object that is connected to my addin
and perform the actions I need. I don't know yet how can I write an OLE
object in C# and what should I implement for the above requirements to work.

Does anyone have any ideas how to implement my special shape?
Do you think that one of the options (A-D) is the answer? Or do you have
other idea?

Your help is highly appreciated.
Avivit
 
C

Chirag

You can perhaps write an event handler for WindowSelectionChange() event.
This event fires for a lot of things and hence you would need to filter for
the ones you are interested in. It does fire for delete of a shape (since
the selection now moves away from the shape that was deleted) and paste a
shape (since the selection is now on the newly pasted shape). You might want
to tag your special shape with an identifier so that you can easily find it.
When your special shape's location changes, you can move it back to the
intended location. Perhaps add your special shape to the slide master -
users go to slide master on rare occasions only.

- Chirag

PowerShow - View multiple PowerPoint slide shows simultaneously
http://officeone.mvps.org/powershow/powershow.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top