Custom image for group in custom ribbon xml



base on [MS-CUSTOMUI]: group (Group) | Microsoft Learn group component has attribute - image.

But when I using this attribute the icon/image of group doesn't change it and doesn't call LoadImage function from ribbon. (Other elements like - button, dropdowns etc. use custom icons)

Linked document show example for image attribute but used component is button not group.

And I'm wondering what I need to change in xml or the image attribute is doesn't supported for new version of office? I mean Microsoft 365.

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.
3,320 questions
{count} votes

2 answers

Sort by: Most helpful
  1. 2022-08-02T13:07:40.747+00:00

    To provide some more details.
    Small part of ribbon:
    <customUI" xmlns:xsi="" xmlns:im="iManage.WordVstoAddIn.15" xmlns:xxxxx="xxxxxxxx" xmlns="" loadImage="LoadImage" onLoad="RibbonLoad">

    <command idMso="FileNewDefault" onAction="FileNewOverride" />
    <command idMso="PrintPreviewAndPrint" onAction="FilePrintOverride" />
    <ribbon startFromScratch="false">
    <tab idQ="xxxxxxx" insertAfterMso="TabHome" label="RibbonForCustomVsto" keytip="X">
    <group idQ="xxxxxxx" insertBeforeQ="xxxxxxxxx" label="Defaults" image="Icon_32_OtherTemplates">
    <button id="XrefPanel" label="XRef" size="large" onAction="ShowXrefPanel" />
    <box id="box0001" boxStyle="vertical">
    <labelControl id="lbl001" label=" " />
    <labelControl id="lbl002" label=" " />
    <button id="btnRefreshAll" imageMso="RefreshAll" screentip="Refresh Document fields" getEnabled="ShowWizardGetEnabled" size="normal" onAction="UpdateDocumentCoiOnAction" />
    <button id="EditAuthors2" keytip="U" screentip="Edit your author list" onAction="EditAuthorsOnAction" />
    <group idQ="xxxxxxxxx" insertBeforeQ="xxxxxxxx" label="DMS" image="Icon_32_OtherTemplates">
    <box id="boxDMSOpts1" boxStyle="vertical">
    <control idMso="FileOpen" size="normal" />
    <control idMso="FileClose" size="normal" />
    <control idMso="FileSave" size="normal" />
    <box id="boxDMSOpts12" boxStyle="vertical">
    <editBox id="QuickOpen" tag="openDmsDocument" keytip="OO" screentip="xxxxx" getEnabled="RunCommandEnabled" onChange="RunCommandActionOnChange" />
    <button id="EditProfile" tag="editDmsProfile" label="Edit Profile" keytip="OP" imageMso="FileProperties" screentip="Edit the document's DMS profile" getEnabled="RunCommandEnabled" size="normal" onAction="RunCommandAction" />
    <splitButton id="BtnDocIdOptions" getVisible="InsertDocIdVisible" getEnabled="InsertDocIdEnabled" size="large">
    <button id="BtnInsertDocId" label="Doc ID Options" image="Icon_64_AddDocRef" onAction="BtnInsertDocIdAction" />
    <menu id="MnuInsertDocId">
    <button id="BtnInsertDocId2" label="Doc ID Options" image="Icon_64_AddDocRef" onAction="BtnInsertDocIdAction" />
    <button id="BtnRemoveDocId" label="Remove Doc ID" image="Icon_64_ReferenceRemoval" onAction="BtnRemoveDocIdAction" />
    <control idMso="FileSaveAs" size="normal" />

    LoadImage method:
    public IPictureDisp LoadImage(string imageName)

    I notice that - the LoadImage is not fired to load image for group, but if I set imageMso - is okey.

    But I don't see any particular reason why event is not fired for custom icon.

    0 comments No comments

  2. Oskar Shon 866 Reputation points MVP

    I notice that - the LoadImage is not fired to load image for group, but if I set imageMso - is okey.

    But I don't see any particular reason why event is not fired for custom icon.

    Yes, buttons can have image or imageMso but group too.
    As you see in first case you can have no imaga on group, but in 2nd case you have it


    That's like that it is in full view:


    and code as you try it:

    <group id="Licencja" getLabel="GetLabel" autoScale="true" imageMso="AppointmentColorDialog">  

    Anyway I use older shema for XML

    aa and one more thing.
    Image for group works when you have couple buttons, not single and that do not works in context I suppose.


    0 comments No comments