Selection.LanguageDetected Property (Word)
Published: July 16, 2012
Returns or sets a Boolean that specifies whether Microsoft Word has detected the language of the selected text.
expression Required. A variable that represents a Selection object.
This example checks the active document to determine the language it’s written in and then displays the result.
With Selection If .LanguageDetected = True Then x = MsgBox("This document has already " _ & "been checked. Do you want to check " _ & "it again?", vbYesNo) If x = vbYes Then .LanguageDetected = False .DetectLanguage End If Else .DetectLanguage End If If .Range.LanguageID = wdEnglishUS Then MsgBox "This is a U.S. English document." Else MsgBox "This is not a U.S. English document." End If End With