Primary language of a Word Document RRS feed

  • Question

  • I need to get the primary language of the Word document. But the word API doc.Content.LanguageID returns an undefined value for slightly bigger documents (even if the whole document content is in the same language, English (say))? Why Word is returning wdUndefined?

    Is it a Microsoft bug?

    Parul Gupta

    • Edited by Ninja8 Tuesday, March 13, 2012 6:16 AM
    Tuesday, March 13, 2012 4:45 AM


  • wdUndefined is actually returned for many properties if the selection or range is sufficiently large. Try it with the Bold property in a document where all the text is regular, for example. I suspect this is a design flaw rather than a bug, though. :-)

    Stefan Blom, Microsoft Word MVP
    • Marked as answer by Bruce Song Wednesday, April 4, 2012 6:26 AM
    Wednesday, March 14, 2012 10:48 PM