OnOLExplorerSelectionChange

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

OnOLExplorerSelectionChange
 
km69




Posts: 22
Joined: 2005-11-30
Hi,

I make a outlook add-in and
I want have disable buton when my list of mail is empty
i use this procedure

Thanks


procedure TAddInModule.adxCOMAddInModuleOLExplorerSelectionChange(
Sender: TObject);
var
Expl: TExplorer;
VIntf: OLEVariant;
adxButton: TadxCommandBarButton;
CEnabled: boolean;
begin
CEnabled := false;
Expl := Sender as TExplorer;
try
VIntf := Expl.Selection;

except
VIntf := NULL;
end;
if (not VarIsNull(VIntf)) and (VIntf.Count > 0) then begin
VIntf := VIntf.Item(1);
CEnabled := (VIntf.Class = olMail);
end;
adxButton := adxOlExplorerCommandbarNovaxel.Controls[0].AsButton;
adxButton.Enabled := CEnabled;
end;
Posted 30 Nov, 2005 11:29:29 Top
Dmitry Kostochko


Add-in Express team


Posts: 2830
Joined: 2004-04-05
Hi,

If I understand you right, you need to handle the OnFolderSwitch event and disable your button if OutlookApp.ActiveExplorer.CurrentFolder.Items.Count = 0

Posted 01 Dec, 2005 07:05:06 Top
karim




Posts: 22
Joined: 2005-11-30
Thank you Dmitry
It's exactely what i want
Posted 01 Dec, 2005 08:01:03 Top
Dmitry Kostochko


Add-in Express team


Posts: 2830
Joined: 2004-04-05
Ok, good luck.

Posted 01 Dec, 2005 08:20:45 Top