How to access built-in ribbon controls in Outlook addin 2010 - outlook

I have created a ribbon control called 'RBS' with type as
RibbonType.Appointment
If i click on the 'Appointment'/'New Meeting' in the calendar window, along with the built-in groups, 'RBS' option also get listed out.
I want to set 'RBS' as selected by default while opening 'New Apponitment'/'New Meeting', for this i want to access built-in tab controls, I have tried as like below,
ThisRibbonCollection ribbonCollection =
Globals.Ribbons
[Globals.ThisAddIn.Application.ActiveInspector()];
but which always pulls out the created ribbon item for all types of inspector.
pls let me know how to access buitl-in tab controls say like 'Appointment' which is selected by default if we click on 'New Appointment'/'New Meeting'

Related

VSTO Outlook: Add new icon to the Outlook items shown in the explorer email list

On folder selection (Inbox, Deleted, Sent, etc.) the Outlook email items are shown listed in the explorer view as a list of Outlook items.
For each Outlook items, some icons (attach, etc.) are show on the right. How can I add new icons there for each outlook item? I want to do the same as explained here or here, but instead of changing an existing one, I would like to add a new one/s.
Additionally (this is optional) it would be great if I could execute some code when user clicks on it but I am ok if I can just show it.
UPDATE 05/10/2022
There are two posibilities:
Add new columns to the message grid preview in the explorer view, I mean put more columns at the beginning or after the last column (flag one). This view is obtained when you resize the width of the messages grid:
Use the existing last column of the messages grid preview, marked with a flag, and put there more icons with its click event handlers.
Is it possible to implement both above solutions?
There is no trivial way to inject custom icons there. The best what you could do is to use the PR_ICON_INDEX property with a set of predefined icons. The property contains a number that indicates which icon to use when you display a group of email objects.
As explained in the articles mentioned in your post you can use the PropertyAccessor.SetProperty to set up an icon for Outlook items.
Additionally (this is optional) it would be great if I could execute some code when user clicks on it but I am ok if I can just show it.
You can handle the SelectionChange event of the Explorer class which is fired when the user selects a different or additional Microsoft Outlook item programmatically or by interacting with the user interface. The Outlook object model doesn't provide any other events for that.
There is no way to add a new icon next to the old one - the message view in Outlook does not support that level of customization.
The only way to replace a build-in icon with a truly custom one (instead of using one from a few dozen predefined icons) is to create a custom form (even if exposes no customization) and specify an icon for that form. If the message class (MailItem.MessageClass) matches that of a custom form, Outlook will show your custom icon. Not ideal at all.

Force Outlook.MailItem.HTMLBody to update in the explorer preview pane

Just after receiving an email I modify the Outlook MailItem with some values for the subject and HTMLBody properties. Later in the explorer when I select it, the HTMLBody which I updated previously just after receiving it, it's not being shown with the content updated in the explorer preview pane. How can I force to Outlook refresh it without saving the Outlook.MailItem?
Typically you need to save changes by calling the Save method on the item and then changing selected item in the Explorer window (see the Selection property of the Explorer class) or just changing the CurrentFolder property.
If you don't want to do something like that you may also consider displaying an Outlook form region instead. It can be an adjucent one which adds a bit of information on top of the email on the reading pane or just complete replacement of the view, so you could display your information instead of a particular item's preview. You may find Advanced Outlook view and form regions helpful.
If the item has not been selected prior to updating HTMLBody, selecting it should show the latest data as long as you remember to call MailItem.Save.
Or use Explorer.ActiveInlineResponseWordEditor - it returns Word.Document object currently shown in the preview pane, and you can try to modify that instead.

VSTO CommandBarButton click modifier

I create a toolbar menu hierarchy in Outlook using VSTO, CommandBarPopup and CommandBarButton. I set a Click handler on the CommandBarButton's and everything works fine, but I would like to be able to do different things in the click handler depending on whether the user right-clicked on the menu, or shift-left-clicked or what not (for example, to include or not include the original message when automatically composing a template reply).
How do I detect which mouse button the user clicked with, or whether shift, alt, or ctrl keys were pressed when the user clicked?
In the event handler you can use the Keyboard.GetKeyStates method which gets the set of key states for the specified key.
// Uses the Keyboard.GetKeyStates to determine if a key is down.
// A bitwise AND operation is used in the comparison.
if ((Keyboard.GetKeyStates(Key.LeftShift) & KeyStates.Down) > 0)
{
// the left shift is pressed now
}
CommandBars were deprecated with Office 2010. You need to use the Fluent UI for creating a custom UI in the add-in. There are two main ways in VSTO to create a custom UI:
Walkthrough: Create a custom tab by using the Ribbon Designer
Walkthrough: Create a custom tab by using Ribbon XML
A context menu is customized using the Fluent UI as well. See Extending the User Interface in Outlook 2010 for more information.
The Fluent UI is described in depth in the following series of articles:
Customizing the 2007 Office Fluent Ribbon for Developers (Part 1 of 3)
Customizing the 2007 Office Fluent Ribbon for Developers (Part 2 of 3)
Customizing the 2007 Office Fluent Ribbon for Developers (Part 3 of 3)

How do I disable a ribbon button on multiple select of records in account view in Dynamics 365?

I am working on dynamics 365. I need to disable a button, say assign, from the ribbon in case of multiple select in acccount view. How can I do that?
This can be achieved by straight forward EnableRule available named SelectionCountRule
Read more
Make sure to take a backup of Application ribbon/Entity before touching the customizations. Also you need to click the context menu “customize button” / “customize command” if you are customizing OOB button like Assign to retain the existing Rules/behavior & to add your custom rules/behavior.

How can I add ICON similar delete ICON in views on CRM 2013

Is it possible to add an icon to a view in CRM – similar to how they now have a delete icon when you hover over a record but we would want the icon to be available all the times based on the status or other factors.
The supported method is to add a ribbon button. I find this tool to be helpful: http://www.develop1.net/public/Download%20Ribbon%20Workbench%202013.aspx

Resources