Search code examples
google-apps-scripticonsmenuitem

Add item with icon to a menu in Google Apps Script


Is it possible to add a menu item with an icon (like the icons of undo/redo button) to a custom menu item?

The documentation of the Class Menu doesn't mention it, so I guess it's not possible, but maybe there's a way to achieve this?

Thanks!


Solution

  • You can not use custom icons i suppose but you can use html character codes like this:

    DocumentApp.getUi().createMenu('☁ Cloud')
      .addItem("🖋 Pen", 'showHtmlBlaBla')
      .addToUi();
    

    You can look here for some codes