none
How to get the current language of the word document? RRS feed

  • Question

  • Hello All,

    Unfortunately when we open the first instance of Word and try to get the language without making any changes through keyboard then we are getting the language from “Microsoft Office Language settings 2007” -> “Primary Editing Language” but if we open a new document through our shared addin or if we change the text/language of the document then we can get the correct language of the document.

    Any idea from where we can get the current language of the document in all cases

     

    Thanks in Advance

    Wednesday, September 7, 2011 1:57 PM

All replies

  • Could you please show us the code relevant to your problem. I'd like to see what's meant by "open the first instance of Word" and "try to get the language"...

    It would also help to understand whether this is with no document open, a new document open, or an existing document with text open.

    Language formatting in Word is a complex beast. So we'd also need to know

    1. The language setting in Windows

    2. The default language setting in Word (especially, whether 1 & 2 are different)

    3. The language of any text in the document (assuing the third option, above)

    I also recommend you work through http://homepage.swissonline.ch/cindymeister/LangFmt.htm to understand how things work and where it may be going wrong.


    Cindy Meister, VSTO/Word MVP
    Wednesday, September 7, 2011 4:30 PM
    Moderator
  • Hi Devloper Solution,

    What's the situation on your side now? Based on my understanding, when you make changes to the document, you could get the correct language of the document. But if you did not make any changes, then you are getting the language from “Microsoft Office Language settings 2007” -> “Primary Editing Language”.

    Could you please describe how do you get the correct language of the document when you make changes? As Cindy suggested, would you mind providing the code on your side?

    Have a nice day.

    Best regards


    Liliane Teng [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, September 20, 2011 3:47 AM