Is there any way to execute the Print or Export buttons on the Sharing ribbon? I'm trying to write a simple tool that automates the creation of a layout and I'd like to be able to trigger the stock tools from a button on my dockpane.
Here is a sample that shows you how you can use ArcGIS Pro commands in your own add-ins: HookProCommands
In your case, here are the snippets to execute Pro's Export button. The id to use for the print button is: "esri_sharing_PrintMap"
IPlugInWrapper wrapper = FrameworkApplication.GetPlugInWrapper("esri_sharing_ExportMap"); var command = wrapper as ICommand; // tool and command(Button) supports this if ((command != null) && command.CanExecute(null)) command.Execute(null);
Great! Thank you very much!