Get Microsoft Office 365 Language Value Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
Laeark
Posts: 4
Joined: 04 Jul 2020, 16:55

Get Microsoft Office 365 Language Value

04 Jul 2020, 17:22

Hello, I have used Autohotkey in many programs,
In this case I have come to work with Office in both languages: Spanish and English, initially at school and then for work.

Is there a way to identify with Autohotkey the current language of Office ?, currently I am using the newest version of Office 365 (64 bits), I have learned shortcut keys in both languages(i mean, when you want to Search, in English you press Ctrl + F, and in Spanish you use Ctrl + B, etc.) , but when I use Autohotkey, there get to be problems because Autohotkey gets to call other functions because the shortcuts are different if office is in different languages.

What I have done so far is to make 2 separate scripts: if I am using the Office version in Spanish and another one for English, but I would like to merge both into 1 file and use an IF statement that detects the Office language and acts according to which version it detected. I'm interested in the value of the language, anything else is just secondary. For Word and Excel

I found these links that get to get direct values ​​from the office but I can't find a variable for the language.

https://www.autohotkey.com/boards/viewtopic.php?f=7&t=8978
https://www.autohotkey.com/boards/viewtopic.php?f=6&t=23164

Can anyone help me please? :)
User avatar
flyingDman
Posts: 806
Joined: 29 Sep 2013, 19:01

Re: Get Microsoft Office 365 Language Value  Topic is solved

05 Jul 2020, 16:49

Could you run this in both versions and see if what it returns:

Code: Select all

xl := ComObjActive("Excel.Application")							; Excel  word.application for MSWord
msgbox % xl.International(1)
It returns 1 in English (and I guess it is 2 in Spanish)
Laeark
Posts: 4
Joined: 04 Jul 2020, 16:55

Re: Get Microsoft Office 365 Language Value

11 Jul 2020, 01:02

flyingDman wrote:
05 Jul 2020, 16:49
Could you run this in both versions and see if what it returns:

Code: Select all

xl := ComObjActive("Excel.Application")							; Excel  word.application for MSWord
msgbox % xl.International(1)
It returns 1 in English (and I guess it is 2 in Spanish)
It worked Thank you very much! but...

gives an error at first run it rerturns a empty value, :(
but when continuing the script again it returns a 34.000000 and with english it returns an 1.000000

this is what AHK returns
Error 0x800401F3 - Cadena clase no válida (String class not valid)
--> xl := ComObjActive("Excel.Application")
msgbox % xl.International(1)
Return

Continue running the script?

This also happens
Error 0x800401F3 - Operación no disponible (Operation not aivailable)
--> xl := ComObjActive("Excel.Application")
msgbox % xl.International(1)
Return

Continue running the script?

i press yes and returns a empty msgbox, then i run it again and returns the 1.000000 or 34.000000
until i close Excel and i open it again it repeats again.

Is there a solution to this? :!:
User avatar
flyingDman
Posts: 806
Joined: 29 Sep 2013, 19:01

Re: Get Microsoft Office 365 Language Value

11 Jul 2020, 11:35

I cannot duplicate the error and for me it always returns 1 the first time.
I know that Error 0x800401F3 happens sometimes when Excel is not properly registered. Go to the MS account information site to see if your device is listed.
Laeark
Posts: 4
Joined: 04 Jul 2020, 16:55

Re: Get Microsoft Office 365 Language Value

13 Jul 2020, 13:00

flyingDman wrote:
11 Jul 2020, 11:35
I cannot duplicate the error and for me it always returns 1 the first time.
I know that Error 0x800401F3 happens sometimes when Excel is not properly registered. Go to the MS account information site to see if your device is listed.
This error was happening in my Laptop that i used when i was at collegue, thus having the licence from my college,
i have already bought the office 365 pack since last year and i didn't change the licence from my account from the laptop,
so i chaged the licence from my account and after that, the error didn't happen again.

Thank you very much

Return to “Ask For Help”

Who is online

Users browsing this forum: AHKStudent, badda, colmik, Epialis, kczx3, labrint, Metrium, Smile_ and 50 guests