c# - Undo action when deleting shapes in PowerPoint -
i have 2 shapes: , b in powerpoint.slide. used tutorial grab shape events including removing or creating shapes.
when got notified deleting shape a, delete shape b @ same time. powerpoint understand deleting shape a, , deleting shape b 2 separate actions. therefore, after undo, shape b shown, not shape a. however, want shape shown well. how can that?
i experiment deleting shape a, , shape b programmatically @ once:
shapea.delete(); shapeb.delete();
and if undo, powerpoint recover 2 shapes , b me. it's need.
what thinking right trigger undo manually code.
if user undos, shape b shown. @ time, check on existence of shape (by finding via shape.id or shape.name in powerpoint). if shape not exist, undo manually.
powerpoint.shape shapea = shapes[nameshapea]; if (shapea != null) { application.commandbars.executemso("undo"); }any other workarounds?
c# vsto office-interop powerpoint-vba
No comments:
Post a Comment