Unable to create ribbon items in the "OnRibbonBeforeCreate" event in Outlook 2010

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

Unable to create ribbon items in the "OnRibbonBeforeCreate" event in Outlook 2010
 
David BARGAUD




Posts: 2
Joined: 2015-03-24
Hello,

I miss something and cannot solve it by myself.
Could you please tell me what is wrong in this code.
I'm trying to create new element for the ribbon during the "OnRibbonBeforeCreate" event.
The ribbon tab allready exists (static).
Please see my code below :

var
aButton : TadxRibbonCustomControl;
begin
aButton := adxRibbonTab1.Controls[0].AsRibbonGroup.Controls.Add(rctButton);
aButton.AsRibbonButton.Caption := 'hello';
aButton.AsRibbonButton.Visible := True;
aButton.AsRibbonButton.Ribbons := [msrOutlookMailRead, msrOutlookMailCompose, msrOutlookMeetingRequestRead, msrOutlookMeetingRequestSend,
msrOutlookAppointment, msrOutlookContact, msrOutlookJournal, msrOutlookTask, msrOutlookDistributionList,
msrOutlookReport, msrOutlookResend, msrOutlookResponseRead, msrOutlookResponseCompose,
msrOutlookResponseCounterPropose, msrOutlookRSS, msrOutlookPostRead, msrOutlookPostCompose,
msrOutlookSharingRead, msrOutlookSharingCompose, msrOutlookExplorer];
aButton.AsRibbonButton.Ribbons2010 := [msrOutlookExplorer2010];
end;
Posted 24 Mar, 2015 04:57:08 Top
Andrei Smolin


Add-in Express team


Posts: 14137
Joined: 2006-05-11
Hello David,

You've missed the button's Id. The Id must start with a letter.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 24 Mar, 2015 05:33:17 Top
David BARGAUD




Posts: 2
Joined: 2015-03-24
Effectively :)

Thank you for your help.
Posted 24 Mar, 2015 06:06:12 Top
Andrei Smolin


Add-in Express team


Posts: 14137
Joined: 2006-05-11
You are welcome ))

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 24 Mar, 2015 06:40:03 Top