Finding a control in Outlook - the junk mail popup

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

Finding a control in Outlook - the junk mail popup
 
Trying out ADX VCL


Guest


Help please?

I am trying to make an add-in button that clicks the Junk-email popup.
Adding the command bar and button was easy using ADX VCL.

I found the folloing VB code


    Set myOlApp = CreateObject("Outlook.Application")
    Dim ctl As CommandBarControl ' Junk E-mail flyout menu
    Dim subctl As CommandBarControl ' Add to Junk Senders list menu

    Set ctl = myOlApp.ActiveExplorer.CommandBars.FindControl(Type:=msoControlPopup, ID:=31126)
    Set subctl = ctl.CommandBar.Controls(1)
    'MsgBox subctl.Caption
    subctl.Execute


Now I am trying to do the same thing using the following Delphi code.
The error I get is 'Not enough actual parameters' for the FindControl call.


procedure TAddInModule.OutlookJunk;
var ctl: TadxCommandBarControl;     // Junk E-mail flyout menu
var subctl: TadxCommandBarControl;  // Add to Junk Senders list menu
var ID: integer;
var AType: TOleEnum;
begin
  // Click Outlook Junk mail menu popup
   //
    id:=31126;
    AType := $0000000A;

    ctl := OutlookApp.ActiveExplorer.CommandBars.FindControl(AType, id);
    subctl := ctl.CommandBar.Controls(1);
    subctl.Execute;


end;


Any help/guidance would be greatly appreciated.

Thank you.
Posted 05 Apr, 2005 13:51:41 Top
Dmitry Kostochko


Add-in Express team


Posts: 2741
Joined: 2004-04-05
Hi Guest,

Try the following code:
ctl := OutlookApp.ActiveExplorer.CommandBars.FindControl(AType, id, EmptyParam, EmpryParam);

Posted 05 Apr, 2005 13:55:31 Top