Einzelnen Beitrag anzeigen

Walter Landwehr

Registriert seit: 28. Mär 2006
Ort: 32816 Schieder-Schwalenberg
395 Beiträge
 
Delphi 10.4 Sydney
 
#7

AW: Office 2010 - Click-To-Run - Installation erkennen

  Alt 8. Feb 2014, 09:30
Hallo,

ich löse das so:
Delphi-Quellcode:
function WordVersion: Double;
begin
  Result := 0.0;
  with TRegistry.Create do
  begin
    try
      if (KeyExists('Software\Microsoft') = True) then
      begin
        OpenKeyReadOnly('Software\Microsoft');
        if (KeyExists('Word\7.0') = True) then // Office 95
              Result := 7.0
      else
        if (KeyExists('Office') = True) then
        begin
          OpenKeyReadOnly('Office');
          if (KeyExists('8.0\Word') = True) then // Office 97
             Result := 8.0
          else
             if (KeyExists('9.0\Word') = True) then // Office 2001
               Result := 9.0
          else
             if (KeyExists('10.0\Word') = True) then // Office XP
               Result := 10.0
          else
             if (KeyExists('11.0\Word') = True) then // Office 2003
               Result := 11.0
          else
             if (KeyExists('12.0\Word') = True) then // Office 2007
               Result := 12.0
          else
             if (KeyExists('14.0\Word') = True) then // Office 2011
               Result := 14.0
          else
             if (KeyExists('15.0\Word') = True) then // Office 2013
               Result := 15.0;
        end;
      end
    finally
           Free;
      end;
  end;
end;
Walter Landwehr
Mfg

Walter
  Mit Zitat antworten Zitat