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 properties - Office Add-in Express Reference

<< Previous

Table of contents

Next >>


TaxpAddIn properties


HostApp

Returns a reference to the host application interface.

property HostApp: OLEVariant; (read-only)

Returns a reference to the interface (HostApp.Application) of the host application, where the add-in is running. Allows accessing interfaces of the host application and their properties and methods. The reference is kept actual all the time when add-in is running.

Sample code:

procedure TMySecondAddIn.AddIn_ControlEvent(const Tag: string;
ICtrl: IaxpControl);
begin
if Tag = cbCountryTag then begin
HostApp.Selection.Value := (ICtrl as IaxpComboBox).Text;
end;
end;
Page Top

HostType

Returns host application type.

property HostType: TaxpOfficeHostApp; (read-only)

Returns the type of the host application, where the add-in is running. Allows identification of host application. Is useful in developing COM Add-ins working in several host applications. The value is kept actual all the time when add-in is running.

Sample code:

procedure TMySecondAddIn.AddIn_ControlEvent(const Tag: string;
ICtrl: IaxpControl);
begin
if Tag = cbCountryTag then
if HostType = ohaExcel then
HostApp.Selection.Value := (ICtrl as IaxpComboBox).Text
else
if HostType = ohaWord then
HostApp.Selection.TypeText(Text:=
(ICtrl as IaxpComboBox).Text);
end;

Page Top

ExcelApp, WordApp, OutlookApp, PowerPointApp, AccessApp, ProjectApp, FrontPageApp

Returns the object wrapper instance of the current host application. Read-only.

property ExcelApp: Excel2000.TexcelApplication;
property WordApp: Word2000.TWordApplication;
property OutlookApp: Outlook2000.TOutlookApplication;
property PowerPointApp: MSPPt2000.TPowerPointApplication;
property AccessApp: Access2000.TAccessApplication;
property ProjectApp: Project2000.TProjectApplication;
property FrontPageApp: FrontPage2000.TFrontPageApplication;

Allows accessing the host application through the Delphi automation object wrapper. Each of the properties return the actual instance for the corresponding host application, otherwise return NIL. For example, the ExcelApp property will return the actual instance if the current host application is Excel and return NIL if the current host application is Word.

The instance is kept actual all the time when add-in is running including the Finalize method. Sample code:

procedure TMySecondAddIn.AddIn_ControlEvent(const Tag: string;
ICtrl: IaxpControl);
begin
if Tag = cbCountryTag then
if HostType = ohaExcel then
ExcelApp.Selection.Value[axpLCID] :=
(ICtrl as IaxpComboBox).Text;
end;

Page Top

CmdBars

Returns reference to CommandBars collection of host application.

property CmdBars: IaxpCmdBars; (read-only)

Allows accessing the command bars collection of a host application. The reference is kept actual all the time when add-in is running.

Page Top

Factory

Returns reference to class factory.

property Factory: TaxpFactory; (read-only)

Returns a reference to the instance of the TaxpFactory class. Allows accessing class factory properties. The reference is kept actual all the time when add-in is running.

Sample code:

procedure TMySecondAddIn.AddIn_ControlEvent(const Tag: string;
ICtrl: IaxpControl);
var
Reg: Tregistry;
TemplatePath: string;
Begin
Reg := TRegistry.Create;
try
if Reg.OpenKey(Factory.RegistryKey, True) then begin
TemplatePath := Reg.ReadString('TemplatePath');
if Tag = cbCountryTag then begin
HostApp.Workbooks.Add(TemplatePath +
(ICtrl as IaxpComboBox).Text);
finally
Reg.Free;
end;
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