我知道我们可以在滑动时单击形状时添加动作
ActionSettings [PowerPoint.PpMouseActivation.ppMouseClick] .Csharp中的操作
像下面的代码:

aromaClick = thisSlide.Shapes.AddShape(Office.MsoAutoShapeType.msoShape24pointStar, 10, 10, 20, 20);
Globals.ThisAddIn.aromaClick.ActionSettings[PowerPoint.PpMouseActivation.ppMouseClick].Action = PowerPoint.PpActionType.ppActionRunProgram;
 Globals.ThisAddIn.aromaClick.ActionSettings[PowerPoint.PpMouseActivation.ppMouseClick].Run = "path-to-file";


但是我想知道点击形状发生时是否可以调用函数吗?可能吗?
喜欢调用此函数:

void hello(){
//something
}


谢谢!

最佳答案

问题尚不清楚。您是否要分配一个宏,以便在单击形状时运行?如果是这种情况,则代码是相似的。

Globals.ThisAddIn.aromaClick.ActionSettings[PowerPoint.PpMouseActivation.ppMouseClick].Action = PowerPoint.PpActionType.ppActionRunMacro;
Globals.ThisAddIn.aromaClick.ActionSettings[PowerPoint.PpMouseActivation.ppMouseClick].Run = "Hello";

关于c# - 滑动csharp时单击形状powerpoint时调用函数,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/34411660/

10-15 17:02