rteller00
asked on
PowerPoint COM Add-In - implementing Undo/Redo
I have a PowerPoint COM Add-In. The actions it performs are not put on the Undo stack by PowerPoint, so PowerPoint's Undo does not work. This seems to be a long-standing documented issue.
I have cobbled together some sort of shaky solution by running the line CommandBars.ExecuteMso('Hi deBackgrou ndGraphics ') before each action the Add-In performs that changes the presentation. This has the effect of placing the "Background" command in the Undo stack and allows the user then to Undo and get to that point.
This sort-of works but has three disadvantages:
1) The command I use in the ExecuteMso is as neutral a one as I could find (I tried loads including HideSlide and then setting it back manually, but nothing seemed as uninvasive as this) - but this still MAY upset some user, sometime.
2) This method means that there are two entries in the Undo stack so the user has to click twice. Not too major a price to pay.
3) More serious is that fact that after Undo-ing the action, Redo does not work!! In some way the state is compromised and the Background command has disappeared.
My question is - has anyone successfully implemented undo in this (or any other) way. Do you have a fix particularly for point 3?
Many thanks for your help
Richard Teller
I have cobbled together some sort of shaky solution by running the line CommandBars.ExecuteMso('Hi
This sort-of works but has three disadvantages:
1) The command I use in the ExecuteMso is as neutral a one as I could find (I tried loads including HideSlide and then setting it back manually, but nothing seemed as uninvasive as this) - but this still MAY upset some user, sometime.
2) This method means that there are two entries in the Undo stack so the user has to click twice. Not too major a price to pay.
3) More serious is that fact that after Undo-ing the action, Redo does not work!! In some way the state is compromised and the Background command has disappeared.
My question is - has anyone successfully implemented undo in this (or any other) way. Do you have a fix particularly for point 3?
Many thanks for your help
Richard Teller
ASKER
Thanks, John. Problem is that many of our clients are still 2007 and I'd really like to find a comprehensive solution if possible.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks, John.
Application.StartNewUndoEn
John