Outlook addin with wpf

Add-in Express™ Support Service
That's what is more important than anything else

Outlook addin with wpf
 
Lokesh Sharma




Posts: 18
Joined: 2020-03-15
Hi

I am new to addin express.

I want to create one outlook addin where on minimized task pane I want to add buttons. On click of each button need to expand task pane and show different user interface. I have wpf controls which I want to add in task pane through element host. Please suggest how to achieve it

Regards
Lokesh
Posted 16 Mar, 2020 02:14:50 Top
Andrei Smolin


Add-in Express team


Posts: 18825
Joined: 2006-05-11
Hello Lokesh,

Start with creating a task pane to understand what task pane type you can use. There are two task pane types supported; see sections Custom Task Panes in Office 2007-2019 and Advanced Outlook Regions and Advanced Office Task Panes; see the PDF file in the folder {Add-in Express}\Docs on your development PC.

Add-in Express panes allow customizing the minimized state of the pane; check https://www.add-in-express.com/creating-addins-blog/2016/05/31/customize-appearance-excel-task-panes-outlook-regions/.


Andrei Smolin
Add-in Express Team Leader
Posted 16 Mar, 2020 04:14:23 Top
Lokesh Sharma




Posts: 18
Joined: 2020-03-15
Hi

Thanks for your help. I am able to add task pane which is ADXOIForm. I want to add button in minimized state like https://prnt.sc/r4yo01


I need your help to know how to use ADXOlForm1.ContainerControl.ContainerItems ?
or is there any alternative ?

I have created side bar (minimized task pane) in xaml. It is working without add in express, I bought license of add in express to get rid of close and minimized button at top of task pane. I am not able to add my xaml in task pane or form manager of addin express. I can also use region if it will help.

Can I get any call support where I can show what I want to achieve and reach at correct tutorial or forum?

Regards,
Lokesh
Posted 16 Mar, 2020 07:21:47 Top
Andrei Smolin


Add-in Express team


Posts: 18825
Joined: 2006-05-11
Hello Lokesh,

Ah, you can't customize ContainerItems in that way. We suggest that you use a WPF UserControl to shown your WPF controls on the ADXOlForm; put an ElementHost on the form, first. And, you should imitate the desired behavior by changing the form size and showing the controls corresponding to the minimized state of your application.


Andrei Smolin
Add-in Express Team Leader
Posted 16 Mar, 2020 08:29:11 Top
Lokesh Sharma




Posts: 18
Joined: 2020-03-15
Thanks for your reply.

If I implement as you suggested, I need to remove minimize button, close button, Form icon and lock pane so user can not drag and it feel like in minimized state. is it possible with Add in Express ? please let me know if there are any tutorial to go through to achieve this.

Regards,
Lokesh
Posted 16 Mar, 2020 23:37:04 Top
Andrei Smolin


Add-in Express team


Posts: 18825
Joined: 2006-05-11
Hello Lokesh,

http://temp.add-in-express.com/support/test/MyAddin27-LokeshSharma-forum.zip

This test project demonstrates these features:
- to hide the Minimize button, the ADXOlFormsCollectionItem.IsMinimizedStateAllowed is set to false
- the close button is hidden by default,
- the icon is hidden by setting ADXOlForm.Icon to null in the constructor of the form
- the folders in which to show the form are specified by setting ADXOlFormsCollectionItem.ExplorerItemTypes to Mail; you can specify the folder(s) explicitly - see the ADXOlFormsCollectionItem.FolderName(s) property.
- the ADXOlFormsCollectionItem.UseOfficeThemeForBackground is set to let the form show its Background; this is for better visibility only.


Andrei Smolin
Add-in Express Team Leader
Posted 17 Mar, 2020 01:28:48 Top
Lokesh Sharma




Posts: 18
Joined: 2020-03-15
Hi Andrei,

I have tried but could not run this application. There are lot of build errors, addinexpress.mso.2005, addinexpress.ol.2005 reference are not there. I have tried to add reference addinexpress.outlook.regions but it did not work. I have tried to use addinform in my project. It did not restrict me to drag and change width of my pane.

How can I restrict changing width of task pane?

Regards,
Lokesh
Posted 17 Mar, 2020 05:11:08 Top
Andrei Smolin


Add-in Express team


Posts: 18825
Joined: 2006-05-11
Hello Lokesh,

I'm sorry for this; I should have noticed that you use Add-in Express Regions. Here's another project that has the same functionality that the one above but it is a VSTO project, not Add-in Express project.

http://temp.add-in-express.com/support/OutlookAddIn4-LokeshSharma-forum.zip


Andrei Smolin
Add-in Express Team Leader
Posted 17 Mar, 2020 06:45:33 Top
Lokesh Sharma




Posts: 18
Joined: 2020-03-15
Hi Andrei,

Thanks for your help. I am able to remove minimize button, close button and Form icon.
But, I am still not able to lock add in task pane. I have tried in your given solution, I am able to drag your task pane which is with ActiveCaption back color you can check it here https://prnt.sc/rhxwfa

How can I lock task pane to resize or in other words restrict users to change width of task pane by dragging?

Thanks in advance,
Lokesh
Posted 17 Mar, 2020 13:08:48 Top
Andrei Smolin


Add-in Express team


Posts: 18825
Joined: 2006-05-11
Hello Lokesh,

You are resizing the pane, not dragging it.


Andrei Smolin
Add-in Express Team Leader
Posted 18 Mar, 2020 01:25:36 Top