Calling a Dephi Form from AddIn

Add-in Express™ Support Service
That's what is more important than anything else

Calling a Dephi Form from AddIn
 
Guest


Guest


I am trying to create an AddIn for Word that will show a Delphi Form. The Form is a Wizard to create documents. I have been able to create the AddIn and Form, and it works correctly. I have been unable to figure out how I can access variables from my AddIn module from the Form. Is this possible? If so how? Thanks.
Posted 09 Sep, 2004 23:01:04 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Sure, it is possible. You can override the constructor Create of your form. As an example see the code below:

{ TAddInModule }

procedure TAddInModule.adxCommandBar1Controls0Click(Sender: TObject);
begin
  Form1 := TForm1.Create(Self);
  try
    if Form1.ShowModal = mrOK then
    begin

    end;
  finally
    FreeAndNil(Form1);
  end;
end;

// ...

{ TForm1 }

constructor TForm1.Create(AOwner: TComponent);
begin
  inherited Create(nil);
  if AOwner is TAddInModule then
    FAddInModule := AOwner as TAddInModule
  else
    FAddInModule := nil;
end;


Sincerely,
ADX Support Team
Posted 10 Sep, 2004 05:37:54 Top