check if Word is installed

Author: Thomas Stutz 

 

uses

  Registry;

 

function IsWordInstalled: Boolean;

var

  Reg: TRegistry;

  s: string;

begin

  Reg := TRegistry.Create;

  try

    Reg.RootKey := HKEY_CLASSES_ROOT;

    Result := Reg.KeyExists('Word.Application');

  finally

    Free;

  end;

end;

 

procedure TForm1.Button1Click(Sender: TObject);

begin

  if IsWordInstalled then

    ShowMessage('MS Word is installed.');

end;