Spiros Nikolopoulos
Guest
|
Hi,
I'm using Delphi XE2 and I created an add-in for office apps.
Supported Apps [ohaExcel,ohaWord,ohaPowerPoint].
I wan't to get the host Applications Active Ducument's filename from a taskpanel (TadxCustomTaskPanes) in AddinModule.
I can't find something in Delphi HOWTO or this Forum.
Thanks |
|
Dmitry Kostochko
Add-in Express team
Posts: 2875
Joined: 2004-04-05
|
Hi Spiros,
You can use the global variable that was created by the Add-in Express wizard in the code of your add-in module. Please see the sample below, in my case the global variable is named adxADX_CTPTest:
uses ComObj, ComServ, adxAddin;
{$R *.DFM}
{ TTaskPane1 }
procedure TTaskPane1.Button1Click(Sender: TObject);
begin
if (adxADX_CTPTest.HostType = ohaExcel) then
ShowMessage(adxADX_CTPTest.ExcelApp.ActiveWorkbook.FullName[adxLCID])
else
if (adxADX_CTPTest.HostType = ohaWord) then
ShowMessage(adxADX_CTPTest.WordApp.ActiveDocument.FullName)
else
if (adxADX_CTPTest.HostType = ohaPowerPoint) then
ShowMessage(adxADX_CTPTest.PowerPointApp.ActivePresentation.FullName);
end;
|
|
Spiros Nikolopoulos
Guest
|
|