Can't find idMso for Picture... button on ContextMenuInlinePicture

John Desrosiers 1 Reputation point
2022-10-27T18:26:44.95+00:00

In a Word .doc in compatibility mode I'm specifically looking to hook the Picture... button shown. This is an inline image.

It isn't idMso="PictureFormatDialog" and I've tried a few dozen likely guesses with no luck.

I'm sure my XML is valid since I can modify the behavior of any other control in ContextMenuInlinePicture.

Any ideas?

254826-image.png

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,698 questions
Word Management
Word Management
Word: A family of Microsoft word processing software products for creating web, email, and print documents.Management: The act or process of organizing, handling, directing or controlling something.
907 questions
{count} votes

5 answers

Sort by: Most helpful
  1. John Korchok 5,161 Reputation points
    2022-10-28T00:34:39.007+00:00

    Here's the GitHub page where you can download the all the Fluent UI Control ID spreadsheets from Microsoft. You should be able to find the idMso in the wordcontrols file for your version of Office:

    https://github.com/OfficeDev/office-fluent-ui-command-identifiers

    1 person found this answer helpful.

  2. Hung-Chun Yu 976 Reputation points Microsoft Employee
    2022-10-29T16:40:28.67+00:00

    Hi @John Desrosiers

    I went to the source code directly. I found the following entry.

    <Tcid Name="msotcidCtxUIInlinePicture">
    <Comment>
    </Comment>
    <NameX>ContextMenuInlinePicture</NameX>
    <Rights>Never</Rights>
    </Tcid>

    Hence, I think the answer you are looking for would be "msotcidCtxUIInlinePicture" Let me know if this helped.

    Hung-Chun Yu
    Microsoft Open Specifications Support


  3. Stefan Blom 2,146 Reputation points MVP
    2022-10-30T15:37:26.887+00:00

    The Picture command on the Inline Picture right-click menu has the command ID 2327.

    Where do you want to add this command?


  4. John Korchok 5,161 Reputation points
    2022-10-31T17:31:02.373+00:00

    While you could completely hide the icon, it's considerably easier to simply disable it when a selected image is not the right type. To do this, you'll have to use a getEnabled command in the XML for the Inline Image button. That getEnabled command will link to a macro that uses the WindowSelectionChange event.

    The way this works is that the event listener checks the selection every time it changes. When it runs this check, it gets whether the selected item is a picture. Then, if it is, it looks for the picture type. If the picture type is correct, then getEnabled status for the icon is changed, disabling it for wrong picture types and enabling it for the ones you want.

    There's a learning curve for this. Searching on Word ribbon getenabled and Word WindowSelectionChange event will get you pages that explain the process in detail.


  5. Oskar Shon 866 Reputation points MVP
    2022-11-08T18:32:30.747+00:00

    That can be: ChartStylesGallery

    258421-image.png

    0 comments No comments