Moriarty
Moriarty

Reputation: 2337

How to add to the Undo Stack in PowerPoint programmatically?

I am programmatically changing the fill color of the selected shapes in a powerpoint slide. I also allow the user to keep "live previewing" changes in a custom task pane. For example,

  1. User selects a shape.
  2. Changes the color of the selected shape by clicking on a color in a custom pane.
  3. Repeats step 2 till satisfied.
  4. Presses Undo.

The problem is, when undo is clicked, it goes back the original color, ignoring all the colors the user cycled through. Is there a way to manipulate the undo stack to allow for going back through the colors one-by-one instead?

Upvotes: 1

Views: 593

Answers (2)

Dan
Dan

Reputation: 1959

You can use the Application.StartNewUndoEntry() API available starting with PowerPoint 2010.

Upvotes: 2

Steve Rindsberg
Steve Rindsberg

Reputation: 14809

I've never seen any hint that PPT gives access to the undo stack. You might instead want to implement your own stack and give the user a Previous button in the custom pane.

Upvotes: 2

Related Questions