How to add custom button to "Change Picture" menu in PowerPoint Ribbon?

Fredrik Vestin 20 Reputation points
2023-08-31T12:10:26.2633333+00:00

Hi,

I'm trying to add a button in the Change Picture-menu (Picture Tools/Adjust/Change Picture). However I can't seem to be able to target anything below GroupPictureTools, there must be some elements that I can't find in the documentation (boxes or something). I have tried to target the controls under TabPictureToolsFormat and set them to visible=false to see if I have the correct structure and setting GroupPictureTools to visible=false hides the whole group, but the following XML does not hide the controls in the group.

<?xml version="1.0" encoding="UTF-8"?>
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
	<ribbon>
		<contextualTabs>
			<tabSet idMso="TabSetPictureTools">
				<tab idMso="TabPictureToolsFormat">
					<group idMso="GroupPictureTools">
						<toggleButton idMso="PictureBackgroundRemoval" visible="false" />
						<menu idMso="PictureCorrectionsMenu" visible="false" />
						<menu idMso="PictureColorMenu" visible="false" />
						<gallery idMso="PictureArtisticEffectsGallery" visible="false" />
						<gallery idMso="PictureTransparencyGallery" visible="false" />
						<button idMso="PicturesCompress" visible="false" />
						<menu idMso="MyPictureChangeMenu" visible="false" />
						<splitButton idMso="PictureResetSplitButton" visible="false" />
					</group>
				</tab>
			</tabSet>
		</contextualTabs>
	</ribbon>
</customUI>

Does anyone know the structure under GroupPictureTools and all the idMso's?

And is there a complete example of the original ribbon structure somewhere? Is it possible to get the structure from some object in C#?

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
9,037 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
2,869 questions
0 comments No comments
{count} votes

Accepted answer
  1. John Korchok 4,286 Reputation points
    2023-08-31T15:32:09.5+00:00

    You can't modify a built-in group. Instead, hide the group, then reconstruct it from iDMso commands, including your custom button. Here's some sample XML that show how to replace a group:

    <contextualTabs>
         <tabSet idMso="TabSetChartTools">
             <tab idMso="TabChartToolsDesignNew">
                 <group idMso="GroupChartType" visible="false"/>
                 <!-- Add new Chart Type group -->
                 <group id="ReplaceChartType" label="Type" insertAfterMso="GroupChartData">
                      <button
                         id="ChartChangeCustom"
                         size="large"
                         imageMso="ChartInsert"
                         label="Change Chart Type"
                         supertip="Change to a different type of chart."
                         showImage="true"
                         showLabel="true"
                         onAction="ChartChange"/>
                    <button
                         id="ChartImproveLegend"
                         tag="LegendButton"
                         getEnabled="GetEnabledMacro"
                         size="large"
                         imageMso="ChartPrimaryHorizontalAxisTitle"
                         label="Improve Legend"
                         supertip="Improve legend on some chart types."
                         showImage="true"
                         showLabel="true"
                         onAction="ImprovedLegend"/>
                 </group>
              </tab>
         </tabSet>
    </contextualTabs> 
    

1 additional answer

Sort by: Most helpful
  1. John Korchok 4,286 Reputation points
    2023-08-31T15:26:46.0066667+00:00

    0 comments No comments