Microsoft Excel reporting and 
 data analyzing with practically no coding. 
 .Net, ActiveX, and VCL versions. 
 www.AfalinaSoft.com  

Home    Products    Downloads    Registered users    Support    Prices    Order    Primary Subscription

 

MS Office COM Add-ins. Microsoft Excel reporting 
 and data analyzing


TaxpAddIn - Office Add-in Express Reference

<< Previous

Table of contents

Next >>


TaxpAddIn


Defines an add-in compatible with MS Office COM Add-in architecture.

TaxpAddIn = class(TAutoObject, IDTExtensibility2)
protected
function AddCmdBar(const Name: WideString;
var NewControl: boolean;
Position: MsoBarPosition = msoBarFloating): IaxpCmdBar;
function FindControl(const CmdBarName: WideString;
const Tag: string; Type_: TaxpControlType): IaxpControl;
function AddControl(const CmdBarName, Caption: WideString;
const Tag: string; const Hint: WideString;
Type_: TaxpControlType; var NewControl: boolean;
Before: integer = -1; Popup: IaxpPopup = nil): IaxpControl;
function AddButton(const CmdBarName, Caption: WideString;
const Tag: string; const Hint: WideString;
const ImageIndex: string; const Style: MsoButtonStyle;
var NewControl: boolean; Before: integer = -1;
Popup: IaxpPopup = nil;
TransparentColor: TColor = clDefault): IaxpButton;
function AddEdit(const CmdBarName, Caption: WideString;
const Tag: string; const Hint: WideString;
Style: MsoComboStyle; var NewControl: boolean;
Before: integer = -1; Popup: IaxpPopup = nil): IaxpEdit;
function AddComboBox(const CmdBarName, Caption: WideString;
const Tag: string; const Hint: WideString;
Style: MsoComboStyle; DropDown: boolean;
var NewControl: boolean; Before: integer = -1;
Popup: IaxpPopup = nil): IaxpComboBox;
function AddPopup(const CmdBarName, Caption: WideString;
const Tag: string; const Hint: WideString;
var NewControl: boolean; Before: integer = -1;
Popup: IaxpPopup = nil): IaxpPopup;
// Must be overridden in descendants...
procedure AddIn_Initialize; virtual;
procedure AddIn_Finalize; virtual;
procedure AddIn_ControlEvent(const Tag: string;
ICtrl: IaxpControl); virtual;
public
property HostApp: OLEVariant read FIApp;
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;
end;

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 }
procedure AddIn_Initialize; override;
procedure AddIn_ControlEvent(const Tag: string;
ICtrl: IaxpControl); override;
end;

implementation

uses ComServ;

{ TMyFirstAddIn }

procedure TMyFirstAddIn.AddIn_Initialize;
var
IsNew: boolean;
begin
inherited;
AddCmdBar('My Bar', IsNew);
AddButton('My Bar', 'My Button', 'MyBtnTag',
'This is my button', '', msoButtonCaption, IsNew);
end;

procedure TMyFirstAddIn.AddIn_ControlEvent(const Tag: string; ICtrl: IaxpControl);
begin
if Tag = 'MyBtnTag' then
ShowMessage('Hmm... I click my button!');
end;

<< Previous

Table of contents

Next >>



Developed for

Delphi 5, 6, 7
Excluding Delphi Personal


[ Download it ]

[ Order now ]

Immediate shipment




ADX Toys™

Free sample
add-ins with a complete source code based on Add-in Express.

[  Read more  ]




We are Borland 
 technology partner


Copyright © 1999-2006
All right reserved.
Privacy Policy

Write to WebMaster

Page Top
Add-in Express - COM Add-ins, Smart Tags and RTDS in C#, VB, C++, J#, and Delphi