|
|
|||
Home Products Downloads Registered users Support Prices Order Primary Subscription |
|
||
TaxpAddIn propertiesHostAppReturns 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
end;
HostApp.Selection.Value := (ICtrl as IaxpComboBox).Text;
end;
HostTypeReturns 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
end;
if HostType = ohaExcel then
HostApp.Selection.Value := (ICtrl as IaxpComboBox).Text
else
if HostType = ohaWord then
HostApp.Selection.TypeText(Text:=
(ICtrl as IaxpComboBox).Text);
ExcelApp, WordApp, OutlookApp, PowerPointApp, AccessApp, ProjectApp, FrontPageAppReturns 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
end;
if HostType = ohaExcel then
ExcelApp.Selection.Value[axpLCID] :=
(ICtrl as IaxpComboBox).Text;
CmdBarsReturns 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. FactoryReturns 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;
Begin
TemplatePath: string;
Reg := TRegistry.Create;
end;
try
if Reg.OpenKey(Factory.RegistryKey, True) then begin
finally
TemplatePath := Reg.ReadString('TemplatePath');
if Tag = cbCountryTag then begin
HostApp.Workbooks.Add(TemplatePath +
(ICtrl as IaxpComboBox).Text);
Reg.Free;
end;
|
Developed forDelphi 5, 6, 7
[ Download it ] Immediate shipment
|