I have one add-in in ribbon.
This is not VSTO add-in.This is developed in C#.
I have implemented a functionality to enable/disable add-in control on change of mail selection.
What i am facing...
- Open outlook
- No mail selected
- Outlook reading-pane shows 'Select an item to read'
- Add-in is being enabled in this case
- In this case, I want to disable my add-in control
I want to detect below things :
- If mail is not opened in outlook reading-pane.
- If outlook reading-pane showing 'Select item to read'.
Thanks for answers in advanced.
CodePudding user response:
If mail is not opened in outlook reading-pane. If outlook reading-pane showing 'Select item to read'.
In both cases the Selection property returns a Selection
object that contains the item or items that are selected in the explorer window.
The Selection
property does not include any conversation header objects. Call the Selection.GetSelection
method, providing olConversationHeaders
as the argument, to obtain conversation header objects that are selected in the explorer.
If the current folder displays a folder home page, this property returns an empty collection. Also, if a group header such as Today
, or a conversation group header is selected, the Count
property on the returned Selection
object is zero.
Also if you want to know whether a reading pane is visible in Outlook you need to use the Explorer.IsPaneVisible method which returns a boolean indicating whether a specific explorer pane is visible.