Articles   Members Online:
-Article/Tip Search
-News Group Search over 21 Million news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
How to find out which language version of Word is installed Turn on/off line numbers in source code. Switch to Orginial background IDE or DSP color Comment or reply to this aritlce/tip for discussion. Bookmark this article to my favorite article(s). Print this article
13-Mar-03
Category
OLE
Language
Delphi 3.x
Views
129
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
DSP, Administrator
Reference URL:
DKB
			Author: Lou Adler

How can I get the language of an Office installation? I need to add a new menu 
item, but the captions are Office language dependent (File - English, Archivo - 
Spanish, etc. )

Answer:

1   { ... }
2   MsWord := CreateOleObject('Word.Basic');
3   try
4     {Return Application Info. This call is the same for English and 
5   	French Microsoft Word.}
6     Lang := MsWord.AppInfo(Integer(16));
7   except
8     try
9       {For German Microsoft Word the procedure name is translated}
10      Lang := MsWord.AnwInfo(Integer(16));
11    except
12      try
13        {For Swedish Microsoft Word the procedure name is translated}
14        Lang := MsWord.PrgmInfo(Integer(16));
15      except
16        try
17          {For Dutch Microsoft Word the procedure name is translated}
18          Lang := MsWord.ToepasInfo(Integer(16));
19        except
20          {If this procedure does not exist there is a different translation
21  			  of Microsoft Word}
22          ShowMessage('Microsoft Word version is not German, French, Dutch, Swedish
23  				 or English.'
24          Exit;
25        end;
26      end;
27    end;
28  end;
29  ShowMessage(Lang);
30  { ... }


			
Vote: How useful do you find this Article/Tip?
Bad Excellent
1 2 3 4 5 6 7 8 9 10

 

Advertisement
Share this page
Advertisement
Download from Google

Copyright © Mendozi Enterprises LLC