|
|
|||
Home Products Downloads Registered users Support Prices Order Primary Subscription |
|
||
TaxpAddInDefines an add-in compatible with MS Office COM Add-in architecture.
TaxpAddIn = class(TAutoObject, IDTExtensibility2) protected
function AddCmdBar(const Name: WideString;
public
var NewControl: boolean;
function FindControl(const CmdBarName: WideString;
Position: MsoBarPosition = msoBarFloating): IaxpCmdBar;
const Tag: string; Type_: TaxpControlType): IaxpControl;
function AddControl(const CmdBarName, Caption: WideString;
const Tag: string; const Hint: WideString;
function AddButton(const CmdBarName, Caption: WideString;
Type_: TaxpControlType; var NewControl: boolean; Before: integer = -1; Popup: IaxpPopup = nil): IaxpControl;
const Tag: string; const Hint: WideString;
function AddEdit(const CmdBarName, Caption: WideString;
const ImageIndex: string; const Style: MsoButtonStyle; var NewControl: boolean; Before: integer = -1; Popup: IaxpPopup = nil; TransparentColor: TColor = clDefault): IaxpButton;
const Tag: string; const Hint: WideString;
function AddComboBox(const CmdBarName, Caption: WideString;
Style: MsoComboStyle; var NewControl: boolean; Before: integer = -1; Popup: IaxpPopup = nil): IaxpEdit;
const Tag: string; const Hint: WideString;
function AddPopup(const CmdBarName, Caption: WideString;
Style: MsoComboStyle; DropDown: boolean; var NewControl: boolean; Before: integer = -1; Popup: IaxpPopup = nil): IaxpComboBox;
const Tag: string; const Hint: WideString;
// Must be overridden in descendants...var NewControl: boolean; Before: integer = -1; Popup: IaxpPopup = nil): IaxpPopup; procedure AddIn_Initialize; virtual; procedure AddIn_Finalize; virtual; procedure AddIn_ControlEvent(const Tag: string;
ICtrl: IaxpControl); virtual;
property HostApp: OLEVariant read FIApp;
end;
property HostType: TaxpOfficeHostApp read FHostType; property CmdBars: IaxpCmdBars read FICmdBars; property Factory: TaxpFactory read GetFactory; // Host apps wrappers (actual for the corresponding HostType) property ExcelApp: Excel2000.TExcelApplication read FExcel; property WordApp: Word2000.TWordApplication read FWord; property OutlookApp: Outlook2000.TOutlookApplication
read FOutlook;
property PowerPointApp: MSPPt2000.TPowerPointApplication
read FPowerPoint;
property AccessApp: Access2000.TAccessApplication
read FAccess;
property ProjectApp: Project2000.TProjectApplication
read FProject;
property FrontPageApp: FrontPage2000.TFrontPageApplication
read FFrontPage;
TaxpAddIn is a descendant of TAutoObject. It offers all the possibilities of COM Add-in for MS Office applications due to support of the IDTExtensibility2 interface. It allows developing COM Add-ins for MS Word, Excel, Outlook, PowerPoint, Access, and Project. It allows creating command bars and controls for a host application, supporting event processing. TaxpAddIn is an abstract class requiring inheritance. To create a COM Add-in based on this class you should create an Automation Server, one of Automation Objects of which must be a descendant of TaxpAddIn. Usually, the descendant overrides virtual methods AddIn_Initialize, AddIn_Finalize and AddIn_ControlEvent in order to create and initialize command bars and controls, to free resources, and to process events of the control created. TaxpAddIn offers several methods and properties allowing adding a command bar or a control. Supports customizing of command bars and controls by the end user. Sample descendant:
type
TMyFirstAddIn = class(TaxpAddIn, IMyFirstAddIn)
protected
{ Protected declarations }
end;
procedure AddIn_Initialize; override; procedure AddIn_ControlEvent(const Tag: string;
ICtrl: IaxpControl); override;
implementation uses ComServ; { TMyFirstAddIn } procedure TMyFirstAddIn.AddIn_Initialize; var
IsNew: boolean;
begin
inherited;
end;AddCmdBar('My Bar', IsNew); AddButton('My Bar', 'My Button', 'MyBtnTag',
'This is my button', '', msoButtonCaption, IsNew);
procedure TMyFirstAddIn.AddIn_ControlEvent(const Tag: string; ICtrl: IaxpControl); begin
if Tag = 'MyBtnTag' then
end;
ShowMessage('Hmm... I click my button!');
|
Developed forDelphi 5, 6, 7
[ Download it ] Immediate shipment
|