5

I have created a custom task pane in VB.Net for Outlook using the Code given below and I would like to add more content to the header (image and a button) of the User Control instead of just the title. Is there a way I can achieve this?

myUserControl1 = New OutlookTaskPane
        myUserControl1.TabStop = True
        Dim width As Integer = myUserControl1.Width
        myCustomTaskPane = Me.CustomTaskPanes.Add(myUserControl1, "My Custom Task Pane")
        myCustomTaskPane.Width = width
        myCustomTaskPane.Visible = True
        myCustomTaskPane.DockPositionRestrict = Microsoft.Office.Core.MsoCTPDockPositionRestrict.msoCTPDockPositionRestrictNoChange

Let me know if there is any other way of achieving this please. Thanks.

Neophile
  • 5,660
  • 14
  • 61
  • 107

1 Answers1

4

Unfortunately the TaskPane header is not customizable. Only Add-in Express supports similar customizations using their implementation of Advanced Form Regions (although only the header icon and header color can be changed and you can't add Windows Forms controls to it). Another option is to implement your own type of Task Pane so you have complete control over the UI; see https://code.msdn.microsoft.com/OlAdjacentWindows/.

Eric Legault
  • 5,706
  • 2
  • 22
  • 38
  • Could you possibly post a solution using that please to add an image as an example? I'll carry over with the remaining customization myself. Thanks. – Neophile Jul 06 '16 at 11:11
  • See this: http://www.codeproject.com/Articles/27262/Additional-custom-panel-in-Microsoft-Outlook – Eric Legault Jul 06 '16 at 16:46
  • Hi Eric, in that would there be a way to just change the color of the title? Its blue by default :(. – Neophile Jul 15 '16 at 10:58
  • If you implemented your own window as per the "Adjacent Window" approach then you are in complete control of the design, including whatever header you want with whatever color you want. You however cannot change the color of VSTO Task Pane headers. – Eric Legault Jul 15 '16 at 15:58