Link to home
Start Free TrialLog in
Avatar of Jamie Garroch (MVP)
Jamie Garroch (MVP)Flag for United Kingdom of Great Britain and Northern Ireland

asked on

Adding clickable images in the Office backstage fluent UI XML

I'd like to be able to add a new tab to the PowerPoint backstage and within that tab, add groups/containers to built a custom UI to select thumbnails of PowerPoint templates. I'd like to reproduce something close to the File / New tab view that shows multiple template thumbnails:

User generated image
However, after a lot of digging in the backstage model, I can only find the following controls that support [decent sized] images:

<imageControl> problem : doesn't support onAction callback
<task> problem : at the largest size, the image attribute sets an icon at a fixed 64x64 pixels

Open in new window

Is there a way round this to show a "gallery" of clickable images other than having a text based dropdown that when clicked, sets the preview image for the current template? Microsoft state that the gallery control is available in the backstage in this MSDN article but after my digging, it's actually only in the contextMenus section so this appears all I have access to:

User generated image
ASKER CERTIFIED SOLUTION
Avatar of John Wilson
John Wilson
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Jamie Garroch (MVP)

ASKER

Thanks John. This is the test image I have created at 202 x 115 px and included in your XML sample:

User generated image
And this is how your XML snippet renders the image to 32 x 32 px:

User generated image
So are you confirming that there is no way to render an image in the backstage with custom dimensions with an onAction callback as per my 202 x 115 example?
AFAIK the only size options are large, normal and borderless. Large is 32x32.

I can see that isn't really going to do what you need but it's my best shot at the moment

As an aside do you have a decent xml editor in visual studio with intellisense? I can maybe talk you through this privately if not.
Thanks JSRWilson for confirming that custom-sized images with inAction callbacks are not supported in the backstage.
I found an answer JSRWilson. The Hyperlink control renders its image element at the size one creates the image and supports the onAction callback:

<hyperlink id="hyperlink1"
  label="Hyperlink label"
  onAction="OnAction"
  image="slideThumb"
  screentip="Hyperlink screentip"
  supertip="Hyperlink supertip"/>

Open in new window


So this is how it renders my 202 x 115 px slideThumb JPG image:

User generated image
Notes:
1. The target and onAction attributes are mutually exclusive.
2. The label attribute doesn't appear to render if an image attribute is specified :-(
3. The isDefinitive attribute is not supported by this element :-(
4. The callback signature for the hyperlink element is incorrectly stated in this MSDN article as Sub OnAction(control As IRibbonControl, itemID As String, itemIndex As Integer)
Good find. I confirmed all of your comments (labels) Still a useful technique though. I'm meeting the PowerPoint code team in Seattle in November. If I have time I'll ask what can be done / file a bug.