Accessing Outlook TaskPanes Controls

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

Accessing Outlook TaskPanes Controls
Accessing Outlook TaskPanes Controls 
Kim Shoemate




Posts: 2
Joined: 2018-09-25
I've added a TaskPane that I'm using for Outlook using the wizard provided. The taskpane displays as intended an I'm able to access width, height, and visibility from the AddInModule unit without any issues.

I can't seem to figure out how to access any of the controls on the taskpane form from the AddInModule though. Any direction that you could provide would be very helpful, thanks.
Posted 25 Sep, 2018 10:37:58 Top
Andrei Smolin


Add-in Express team


Posts: 16167
Joined: 2006-05-11
Hello Kim,

procedure TAddInModule.adxRibbonTab1Controls0Controls0Click(Sender: TObject;
  const RibbonControl: IRibbonControl);
var
   myPaneControl: IcoMyTaskPane;
begin
   myPaneControl := self.TaskPanes.Items[0].Instances.Items[OutlookApp.ActiveWindow].Control as IcoMyTaskPane;
   if Assigned(myPaneControl) then begin
      myPaneControl.SetCaptionForLabel1('');
   end;
end;


The SetCaptionForLabel1() method above is added to the IcoMyTaskPane interface implemented by the CTP used in the project; see View | Type Library:

  interface IcoMyTaskPane: IDispatch
  {
//...
    [id(0x000000C9)]
    HRESULT _stdcall SetCaptionForLabel1([in] BSTR caption);
  };


Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 26 Sep, 2018 09:50:55 Top
Kim Shoemate




Posts: 2
Joined: 2018-09-25
Perfect, thank you!
Posted 26 Sep, 2018 10:07:21 Top
Andrei Smolin


Add-in Express team


Posts: 16167
Joined: 2006-05-11
Welcome!

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 26 Sep, 2018 10:27:44 Top