您能否帮我编写一个代码,使用C#从powerpoint中删除特定幻灯片中的图像?
答案 0 :(得分:1)
如果您有Visual Studio 2008,请选择PowerPoint加载项模板。
public partial class ThisAddIn
{//this is the event of the startup of the powerpoint
private void ThisAddIn_Startup(object sender, System.EventArgs e)
{//this is the event that will trigger when you select anything in you presentation
this.Application.WindowSelectionChange += new Microsoft.Office.Interop.PowerPoint.EApplication_WindowSelectionChangeEventHandler(Application_WindowSelectionChange);
}
void Application_WindowSelectionChange(Microsoft.Office.Interop.PowerPoint.Selection Sel)
{
//here you will delete the selected item
Sel.Delete();
}
但我建议您阅读有关Microsoft加载项的更多信息,以便您可以实现您想要的内容