Как узнать версию MS Word?

Previous  Top  Next

    
 

 

 

Code:

{ ... }

MsWord := CreateOleObject('Word.Basic');

try

{Return Application Info. This call is the same for English and

       French Microsoft Word.}

Lang := MsWord.AppInfo(Integer(16));

except

try

   {For German Microsoft Word the procedure name is translated}

   Lang := MsWord.AnwInfo(Integer(16));

except

   try

     {For Swedish Microsoft Word the procedure name is translated}

     Lang := MsWord.PrgmInfo(Integer(16));

   except

     try

       {For Dutch Microsoft Word the procedure name is translated}

       Lang := MsWord.ToepasInfo(Integer(16));

     except

       {If this procedure does not exist there is a different translation

                        of Microsoft Word}

       ShowMessage('Microsoft Word version is not German, French, Dutch, Swedish

                                or English.');

       Exit;

     end;

   end;

end;

end;

ShowMessage(Lang);

{ ... }

©Drkb::04422

Взято с Delphi Knowledge Base: http://www.baltsoft.com/