简体   繁体   中英

Automate Addin Ribbon in PowerPoint C#

I would like to automate PowerPoint Addin, which created other side. I program in C# and I have Microsoft Office 2010.

To control PowerPoint for me, it's not a problem. For example this code opens dialog to choose file.

PowerPoint.Application objApp;
objApp = new PowerPoint.Application();
objApp.Visible = MsoTriState.msoTrue;
objApp.CommandBars.FindControl(missing, 23, missing, missing).Execute(); 

I've found source to access ShowBar IDs, but there aren't IDs of Addin. After that I realized it's a Ribbon Addin, but I dont know how can I access the IDs and execute it. I've read lot of articles about Ribbon, but still I didn't get it, how it works. Can somebody help me and explain, what I should do.

Thank you for your time.

If I understand you correctly you are trying to execute the action of a ribbon button that has been added by a third-party add-in. The easiest way would be to use an exposed method of the add-in if that is possible. I don't think there is any other "standard" way to execute the button's action.

A more complicated approach would use IAccessible to access the ribbon features. You can find additional information here:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM