How to set icon size in Outlook 2010 add in c# - c#-4.0

I develope an outlook 2010 add-in,
I have Office.CommandBars cmdBars that holds Office.CommandBarButton,
I set the buttonTemp_Dial.Style = Office.MsoButtonStyle.msoButtonIconAndCaption
and buttonTemp_Dial.Picture have a reference to icon pic.
The icon in add in is small how can I change it to big Icon?
the add-in is in separate tab in Outlook, is there a way to put the add in to the "Home" tab?

If you use the old CommandBars based API, your button will appear on the Addins tab, which is probably not something that you want.
Your add-in (on the low level) needs to implement the IRibbonExtensibility interface and return your customization as XML - see http://msdn.microsoft.com/en-us/library/office/bb226712(v=office.12).aspx

Related

If I have a IRibbonUI object stored can I use it to add controls to the ribbon using VBA code?

Given that I have stored the IRibbonUI object onLoad, can I use that to modify the CustomUI.xml in my stub .xlam ribbon? If not, can it be used to add tabs, controls, etc. via VBA code?
The IRibbonUI object can only invalidate, i.e. reset the caches, on already defined controls and switch tabs on the ribbon. However, you can use the invalidation to trigger callbacks which show/hide already-defined controls by using the getVisible property, for example see this answer:
Hide individual custom ribbon buttons.
Or change their images as per:
Excel Ribbon Dropdown background color.
The Ribbon XML is immutable for the life of the related COM add-in. If you want to specify a completely new Ribbon XML, you need another master/controller addin to disconnect and re-connect the COM addin which declared the Ribbon. This is a bit more complicated, so hopefully you can achieve what you need with the getVisible functionality.
Thank you for that confirmation. I saw that this can be done in MS Project but, sadly, not in Excel.
All of the other items you mentioned regarding callbacks are in place and working well. Hide/show, changing labels, etc. but always on pre-defined controls.

Is there a way to add custom icons to a ribbon using VBA through a callback to the UI Editor?

I am making a ribbon for my office. I have programmed all the macros already, except for the icons.
In the UI Editor, I have set everything to be done via a callback in VBA.
I have loaded all the icons using the MS Excel stock icons, however I have 9 icons that have to be added as they are not part of the excel standards.
I can't use different icons as the buttons in the ribbon paste the pictures that I need to display as the icons.
In the UI editor, I have set it up that all the buttons use "getimage=getimage" and have programmed a callback in VBA.
I don't seem to be able to change the 9 specific buttons to "image=pic1" and use the icons (pic1-pic9) I have loaded in the UI Editor.
When I try to do that, I get an error saying "the 'Image' attribute is not declared"
So now I am looking for a workaround in VBA.
Current callback code for a standard Icon:
Case "eButton03": RibbonImage = "ObjectPictureFill"
I need the code above to pull in a picture instead of using the standard icon.
let's say the picture is saved in C:\Pic\Pic1.png
Use this list: https://bert-toolkit.com/imagemso-list.html
You can also use or create custom images, add your picture "yourpic.png" via Excel's "Insert Icons" option in the Custom UI Editor.
Use the code
image="yourpic"
To use your picture as a custom icon.

merging custom ribbon controls using custom ui editor

I have created custom ribbon control in both the 2007 and 2010. i have added few features in 2010. i wanna use these new features in 2007 also. so for merging these i have used custom ui editor tool. and i have saved this as well. when i opened up this new to the 2007 all my new controls showed up correctly. but when i open it in the 2010, the controls showed correctly without the icon images. for example, control is "Picture" then nearby this control one small image will be there. this small icon images not showing up in the 2010 version. did i do anything wrong ? please anyone help me for showing it correctly !
Make sure you have added the icons as well to that version's xml. The pictures name must match the xml.
Click Insert and then Icons..., browse and select the pictures you want to use as button images.
You can have different sets of pictures for 2007/2010, but better to only use 2007 UI part if both versions are to be the same.

Customizing Office (Word/Excel/PowerPoint) standard toolbar, ribbon, menu and context menu from my plugin

I've an Office plug-in implemented in C++.
Depends on the context and logic of my plug-in, I would like to enable/disable some existing UI elements of Office (menu, ribbon, context menu, and for old Office CommandBars).
Please help or point me out to resources how to do so (C# or VBA resources also appreciated).
A couple of things to get rid of the main offenders (Ribbon, Command Bar) in Excel VBA.
Show and hide Ribbon interface:
Application.ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",False)"
Application.ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",True)"
Show and hide command bars in older versions of Excel.
1) Show hide ribbon items:
You cannot set the enabled state or toggle the visibility of built in ribbon controls, this functionailty is reserved for inner workings of MS Office - more
The reverse is true, in that you can set enabled state or toggle the visibility of your custom ribbon items.
And likewise the users will be prevented from changing this via the Customize Ribbon interface:
myTabName.Groups[0].Items[0].Enabled = false;
myTabName.Groups[0].Items[1].Visible = false;
2) In terms of command bars, Office context menus, you can perform any customizations such as changing enabled and visibility states and adding your own.
You can also change the command bar properties based on a condition - example
3) For a complete list customizations you can and can't do in the ribbon have a look at these two articales:
Office UI Customization - Comparison of UI Features and Can I customize the ribbon

Custom Backstage View Tab like standard tab FileNew

I want to design own custom backstage view tab that has desing like standard tab FileNew.
How can I (and can I at all) use such tab elements like scrollable button set or large borderless button with text at bottom of one.
There are elements in the BackStage Tabs which are built-in and not available form the programming side. For example, all the individual controls on the Print Backstage Tab cannot be re-used by a developer. I'm afraid that we have the same problem with the File New Backstage. The previews are built-in. You can verify this if you look into the WordControls.xlsx file delivered with the Office 2010 Control-IDs download: There are no controls for the TabNew except for "GroupNewFormTemplates", "GroupNew2003Dialog" and "GroupNewFormPreview".
You can only re-use controls which are defined in the Ribbon Scheme, as Combobox, Edit Control, Button, and so on.
So to display your templates, you must use these default controls, or built something completely different.

Resources