LanguageID in a Word Document (VB)

ManuelR 1 Reputation point
2022-06-06T16:30:12.68+00:00

I have a Microsoft.Office.Interop.Word.Document object, this object has a function named Range, and with that Range I can get the LanguageID of the selected text in the Range.
I have this:

  Dim objDoc As Microsoft.Office.Interop.Word.Document = Document

 Select Case objDoc.Range.LanguageID
                Case WdLanguageID.wdSpanish,
 WdLanguageID.wdSpanishModernSort
                    defaultLang = "es"
                Case WdLanguageID.wdCatalan
                    defaultLang = "ca"
                Case WdLanguageID.wdBasque
                    defaultLang = "eu"
                Case WdLanguageID.wdPortuguese
                    defaultLang = "pt"
                Case WdLanguageID.wdEnglishUK, WdLanguageID.wdEnglishUS
                    defaultLang = "en"
                Case Else
                    defaultLang = "es"
            End Select

How does the LanguageID work? where does it come from? Can I change it? Can I access to it outside the code? (using ms word)

Thank you in advance

VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,562 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,453 questions
Word Management
Word Management
Word: A family of Microsoft word processing software products for creating web, email, and print documents.Management: The act or process of organizing, handling, directing or controlling something.
891 questions
{count} votes