ribbon visibility

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

ribbon visibility
 
Karim




Posts: 170
Joined: 2006-01-02
Hello,

How to display a ribbon only in a mail view and not in contact, task, calendar etc.

Karim
Posted 13 Dec, 2016 08:53:22 Top
Andrei Smolin


Add-in Express team


Posts: 18818
Joined: 2006-05-11
Hello Karim,

You need to handle the PropertyChanging event of the Ribbon tab component. If the context is an Outlook.Explorer, PropertyType = rcptVisible, and the DefaultItemType property of the Outlook.MAPIFolder returned by Explorer.CurrentFolder is olMailItem, then set Value := True; otherwise, set Value := False.


Andrei Smolin
Add-in Express Team Leader
Posted 13 Dec, 2016 10:08:22 Top
Karim




Posts: 170
Joined: 2006-01-02
Hello Andrei,

I want display my tab only in mail selection change.
In my code adxRibbonMyTab get true or false value but my tab Is all the time visible


procedure TAddInModule.adxOutlookAppEventsExplorerSelectionChange(
  Sender: TObject);
var
 OutlookItem: OLEVariant;
begin
  if OutlookApp.ActiveExplorer.Selection.Count > 0 then
  begin
   OutlookItem := OutlookApp.ActiveExplorer.Selection.Item(1);
   if (OutlookItem.class = olMail) then
     adxRibbonMyTab.Visible := true
   else
     adxRibbonMyTab.Visible := false;
  end;
end;
Posted 20 Dec, 2016 16:51:43 Top
Andrei Smolin


Add-in Express team


Posts: 18818
Joined: 2006-05-11
Hello Karim,

To check if the code fragment above works, you can drag a task or contact to that folder and check if selecting it hides the tab.


Andrei Smolin
Add-in Express Team Leader
Posted 21 Dec, 2016 06:08:04 Top