Roger Middlebrook
Guest
|
Outlook 2010
ADX VCL 7.0.1210
I can override the button with idMso "FilePrintQuick" using TadxRibbonCommand and OnAction event handler.
Why can I not do the same with idMso "PrintAttach"?
The "tip" that shows on the QuickPrint button on the Attachment Tools tab shows that Outlook2010 can "see" the PrintAttach override but when I click the button my custom event handler does not run. Outlook simply prints the attachment as normal.
I have tried this in a new ADX COM Addin with only the TadxRibbonCommand in it (with idMso "PrintAttach") calling a simple ShowMessage in its OnAction event handler. I cannot get it to work.
Am I doing something wrong? |
|
Andrei Smolin
Add-in Express team
Posts: 18830
Joined: 2006-05-11
|
Roger,
This works fine for me:
object AddInModule: TAddInModule
OldCreateOrder = True
AddInName = 'coOutlookAttachmentQuickPrint'
SupportedApps = [ohaOutlook]
TaskPanes = <>
Left = 626
Top = 151
Height = 400
Width = 380
object adxRibbonCommand1: TadxRibbonCommand
Id = 'adxRibbonCommand9B851AE0C4F04AAC97E3F40CCB2E8AEF'
IdMso = 'PrintAttach'
OnAction = adxRibbonCommand1Action
Left = 56
Top = 48
Ribbons = [msrOutlookMailRead, msrOutlookExplorer]
Ribbons2010 = [msrOutlookExplorer2010]
end
end
unit OutlookAttachmentQuickPrint_IMPL;
interface
uses
SysUtils, ComObj, ComServ, ActiveX, Variants, Outlook2000, Office2000,
adxAddIn, OutlookAttachmentQuickPrint_TLB, StdVcl, Dialogs, Classes;
type
TcoOutlookAttachmentQuickPrint = class(TadxAddin, IcoOutlookAttachmentQuickPrint)
end;
TAddInModule = class(TadxCOMAddInModule)
adxRibbonCommand1: TadxRibbonCommand;
procedure adxRibbonCommand1Action(Sender: TObject;
const Pressed: Boolean; var Cancel: Boolean);
private
protected
public
end;
implementation
{$R *.dfm}
procedure TAddInModule.adxRibbonCommand1Action(Sender: TObject;
const Pressed: Boolean; var Cancel: Boolean);
begin
ShowMessage('!');
Cancel := True;
end;
initialization
TadxFactory.Create(ComServer, TcoOutlookAttachmentQuickPrint, CLASS_coOutlookAttachmentQuickPrint, TAddInModule);
end.
Andrei Smolin
Add-in Express Team Leader |
|
Roger Middlebrook
Guest
|
Thanks for that reassurance Andrei.
I am beginning to think that it is something to do with my development environment because I am starting to find that ribbon buttons that were invisible yesterday are visible today. I'll check for conflicts.
In the meantime, can you direct me towards sample code that uses the addin's Namespace property?
Roger |
|
Andrei Smolin
Add-in Express team
Posts: 18830
Joined: 2006-05-11
|
You may need to unregister all other COM add-ins...
Roger Middlebrook writes:
In the meantime, can you direct me towards sample code that uses the addin's Namespace property?
In the manual - {Add-in Express}\Docs\adxvcl.pdf - see the section Sharing Ribbon Controls Across Multiple Add-ins.
Andrei Smolin
Add-in Express Team Leader |
|