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?