...get the installed Word version?

Author: r.kleefstra

Category: Objects/ActiveX

uses ComObj;

{
const
  Wordversion97 = 8;
  Wordversion2000 = 9;
  WordversionXP = 10;
  Wordversion2003 = 11;
}

function GetInstalledWordVersion: Integer;
var
  
word: OLEVariant;
begin
  
word := CreateOLEObject('Word.Application');
  result := word.version;
  word.Quit;
  word := UnAssigned;
end;


// Example:
procedure TForm1.Button1Click(Sender: TObject);
begin
  
ShowMessage(IntToStr(GetInstalledWordVersion));
end;

 

printed from
www.swissdelphicenter.ch
developers knowledge base