VSTO and Outlook 2003 Context menus - outlook

I want to have outlook 2003/2007 integration with my application using VSTO. With outlook 2007 it's OK - I have all the hooks I need but with outlook 2003 I can't find how to add context menu item to the mail items in the inbox. I didn't find any event handler for populating the context menu like the one in the 2007 version.
Do you know any workaround?

Site is still viewable in the archive: http://web.archive.org/web/20160405050041/http://www.developerzen.com/2005/04/04/adding-a-button-to-outlooks-context-menu/
To add a button to the Outlook explorer context menu you need to get the “Context Menu” CommandBar.
This command bar instance is only created when the user right clicks in the explorer so in order to know when such a bar is
created you have to listen to the OnUpdate event of the Explorer’s CommandBars collection.
Inside the OnUpdate event handler you can check if the context menu CommandBar exist:
CommandBar bar = ActiveExplorer.CommandBars[“Context Menu”];
After getting the context menu CommandBar you need to change it’s Protection property to allow customization, add your button, and change the Protection back.

Related

Outlook web add-in scan mail item content

I was wondering if there was a way to for url in an outlook item and retrieve them to use them later.
I have a MessageReadCommandSurface add-in, but I only found a way to highlight them using a contextual add-in. Here's the documentation for that: https://learn.microsoft.com/en-us/office/dev/add-ins/outlook/contextual-outlook-add-ins.
Is there any event for newly opened Read command surfaces?
First of all, let's realize that Outlook web add-ins work under the context of the currently selected item only in Outlook. So, each time you select an item your contextual add-in must re-evaluate conditions to activate.
You may also consider implementing a pinnable task pane where you could handle the ItemChanged event. See Implement a pinnable task pane in Outlook for more information. So, if the take pane was loaded and pinned you can just handle the ItemChanged event and process a newly selected item with relying on contextual activations.
The event-based activation can also be helpful depending on your demands. See Configure your Outlook add-in for event-based activation for more information.
If none of the provided options suits your needs I'd suggest filing a feature request at https://aka.ms/M365dev-suggestions .

Vsto Addin to show on home tab

I have created a vsto Addin where I want to show a Ribbon control on Inbox window and when the user clicks reply in same window(not in pop out window).
I was able to set the addin to load on Outlook compose and reply pop out windows.
I tried to set the property controlId as TabMail and selected RibbonType property (selected everything, just tried hopping one of those will work )
Any one have a solution
Do you get any Ribbon UI errors?
By default, if an VSTO Add-in attempts to manipulate the Microsoft Office user interface (UI) and fails, no error message is displayed. However, you can configure Microsoft Office applications to display messages for errors that relate to the UI. You can use these messages to help determine why a custom Ribbon does not appear, or why a Ribbon appears but no controls appear.
To show VSTO Add-in user interface errors
1. Start the application.
2. Click the File tab.
3. Click Options.
4. In the categories pane, click Advanced.
5. In the details pane, select Show VSTO Add-in user interface errors, and then click OK.
For Outlook, the Show VSTO Add-in user interface errors checkbox is located in the Developer section of the details pane. For other applications, the checkbox is located in the General section of the details pane.
Most probably the TabMail id doesn't exist in all contexts and you get an UI error. So, a custom UI is not shown finally. Am I right?

Outlook 2010 VSTO Add-In Keep Current Tab Active

I have a custom xml tab in Office 2010 (using VB.net) when I press a button on my tab it takes me to the desired contact folder but the Ribbon.ActivateTab code doesn't do anything (focus switches to Home tab). Here is the code below, could you tell me what I'm doing wrong?
Public Sub GoToContacts_Click(control As Office.IRibbonControl)
'code to take me to Contact folder
ribbon.ActivateTab("MyTabId")
End Sub
Looks like the tab is activated before the folder is switched...
Try to handle the FolderSwitch event of the Explorer class which is fired when the explorer goes to a new folder, either as a result of user action or through program code. And in the event handler call the ActivateTab method of the IRibbonUI interface.
Where did you get the id of the target tab? Does it belong to your add-in?
p.s. See Ribbon Extensibility in Office 2010: Tab Activation and Auto-Scaling.

events for right click detection in Outlook and Power point

In office applications i want to get the word on which the user right clicks.
i was able to get for Excel and Word. in outlook and PowerPoint i am not able detect the right click event.
In outlook i want to detect right click on a word in mail body.
In power point i want to detect right click in a slide content.
In outlook i have tried the events:
ItemContextMenuDisplay,
AttachmentContextMenuDisplay,
FolderContextMenuDisplay,
ContextMenuClose,
StoreContextMenuDisplay,
ViewContextMenuDisplay,
In power point i have tried:
WindowBeforeRightClick,
can somebody help me with the events to be used?
I will try to answer the Outlook part.
The Outlook object model doesn't provide any events for that. The only possible solution is to add your control to the context menu and handle the getVisible or getEnabled callbacks. Thus, you will be aware when the context menu is going to be displayed. But it seems MS doesn't provide the required IDs for that menu, see Extending the User Interface in Outlook 2010 for more information.
See Office 2013 Help Files: Office Fluent User Interface Control Identifiers
In the case of PowerPoint, WindowBeforeRightClick is the correct event.
You would find that setting Cancel = True in the handler for that event only works if the right-click is on the slide itself. On a shape or within a text range this fails to work as expected.
Workaround is the lock the screen and switch to a different view and back and then update the screen to prevent the contextual menu from appearing for the shape/text range.

Outlook addin custom pop up form

i am creating an addin for outlook . i am stuck with my requirements ... how to open a pop up for entering some input value on click of custom button in ribbon.
i.e How to open a form in outlook UI
simple question it was ..
i am able to open vb form ..
NativeAddIn::ApplicationConfiguration ^appConfigurationform = gcnew NativeAddIn::ApplicationConfiguration();
appConfigurationform->ShowDialog();
To create a ribbon in the outlook
Click on file - go to options - customize ribbon - create a new tab - rename it by clicking on it next drag an action to be performed on the particular ribbon
and import settings
click ok
close the outllok and reopen it again
this is for outlook application 2019.

Resources