whats new ¦  programming tips ¦  indy articles ¦  intraweb articles ¦  informations ¦  links ¦  interviews
 misc ¦  tutorials ¦  Add&Win Game

Tips (1541)

Database (90)
Files (137)
Forms (107)
Graphic (114)
IDE (21)
Indy (5)
Internet / LAN (130)
IntraWeb (0)
Math (76)
Misc (126)
Multimedia (45)
Objects/
ActiveX (51)

OpenTools API (3)
Printing (35)
Strings (83)
System (266)
VCL (242)

Top15

Tips sort by
component


Search Tip

Add new Tip

Add&Win Game

Advertising

42 Visitors Online


 
...get the language of MS Word?
Autor: Mike Shkolnik
Homepage: http://www.scalabium.com/
[ Print tip ]  

Tip Rating (5):  
     


// Question:
// How can I read the default language of installed MS Word application?

// Answer:
// You may initialize Word.Application instance and read a CountryID:

var
  
word: OLEVariant;
begin
  
word := CreateOLEObject('Word.Application');
  CountryID := word.System.Country;
  word.Quit;
  word := UnAssigned;
end;

// After that check this CountryID with next values:
  
wdUS = $00000001;
  wdCanada = $00000002;
  wdLatinAmerica = $00000003;
  wdNetherlands = $0000001F;
  wdFrance = $00000021;
  wdSpain = $00000022;
  wdItaly = $00000027;
  wdUK = $0000002C;
  wdDenmark = $0000002D;
  wdSweden = $0000002E;
  wdNorway = $0000002F;
  wdGermany = $00000031;
  wdPeru = $00000033;
  wdMexico = $00000034;
  wdArgentina = $00000036;
  wdBrazil = $00000037;
  wdChile = $00000038;
  wdVenezuela = $0000003A;
  wdJapan = $00000051;
  wdTaiwan = $00000376;
  wdChina = $00000056;
  wdKorea = $00000052;
  wdFinland = $00000166;
  wdIceland = $00000162;


 

Rate this tip:

poor
very good


Copyright © by SwissDelphiCenter.ch
All trademarks are the sole property of their respective owners