I have an Outlook Task Pane that opens when you open Outlook and I have added this using this approach.
https://msdn.microsoft.com/en-us/library/aa942846.aspx
I am showing and hiding the Task Pane using the example given here:
https://msdn.microsoft.com/en-us/library/bb608590.aspx
So, this works with an email when the user clicks on the toggle button. However, I have added another ribbon control on the New Mail Message window of Outlook and I would like this same Task Pane to be available on the side of that window as well. I managed to create another ribbon control (designer) and added this new button but when I toggle it, it does not open a task pane on the new mail message window. It only toggles the existing task pane window that is available in the inbox.
Code for the New Mail Message Ribbon Control:
Imports Microsoft.Office.Tools.Ribbon
Imports Outlook = Microsoft.Office.Interop.Outlook
Imports Microsoft.Office.Tools
Public Class ComposeSidebarRibbon
Private Sub ComposeSidebarRibbon_Load(ByVal sender As System.Object, ByVal e As RibbonUIEventArgs) Handles MyBase.Load
End Sub
Private Sub SidebarToggleButton_Click(sender As Object, e As RibbonControlEventArgs) Handles SidebarToggleButton.Click
Globals.ThisAddIn.TaskPane.Visible = TryCast(sender, Microsoft.Office.Tools.Ribbon.RibbonToggleButton).Checked
End Sub
End Class
How can I go about doing this?
A Task is.. a task. It's an Outlook item that is stored in a Tasks Folder. A To-Do is any Outlook item that is flagged for follow-up, usually flagged email, as well as all of the tasks in the Task folders in the profile.
As per MSDN you can add more than one ribbon by using different id's for the ribbons -
You can add more than one ribbon to a project. If more than one ribbon shares a ribbon ID, override the CreateRibbonExtensibilityObject method in the ThisAddin class of your project to specify which ribbon to display at run time.
The function to use for this will be similar to -
Protected Overrides Function CreateRibbonExtensibilityObject() As _
Microsoft.Office.Core.IRibbonExtensibility
If myCondition = True Then
Return Globals.Factory.GetRibbonFactory().CreateRibbonManager _
(New Microsoft.Office.Tools.Ribbon.IRibbonExtension() _
{New Ribbon1()})
Else
Return Globals.Factory.GetRibbonFactory().CreateRibbonManager _
(New Microsoft.Office.Tools.Ribbon.IRibbonExtension() _
{New Ribbon2()})
End If
End Function
Please see the MSDN reference HERE
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With