aye2m
aye2m

Reputation: 131

How to Detect Duplicate Slide Event in PowerPoint VSTO?

Is there an event to detect when the user duplicate a slide in PowerPoint?

Upvotes: 0

Views: 139

Answers (1)

Steve Rindsberg
Steve Rindsberg

Reputation: 14809

PowerPoint doesn't fire a specific event when a slide is duplicated; there's just the event it fires when a new slide is added. If you can figure out a way to distinguish a duplicated slide from a newly added (or inserted) slide, that might help.

Since the duplicate will be directly after the original slide, you could compare, say, the number of shapes, type and position of each shape on the duplicate to the immediately preceding slide and if there's a match, it's a fair bet that it's a duplicate.

If you need to trap the event when a user Ctrl+Drags a slide to copy it to another location in a show, things get a bit more complex.

Chirag Dalal has a very useful page listing all of the events that PowerPoint supports and in which version of PPT they're supported:

http://www.officeoneonline.com/vba/events_version.html

Upvotes: 1

Related Questions