Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
LanguageDetected Property
Collapse the table of content
Expand the table of content

Range.LanguageDetected Property (Word)

Returns or sets a value that specifies whether Microsoft Word has detected the language of the specified text. Read/write Boolean.

expression .LanguageDetected

expression Required. A variable that represents a Document object.

Check the LanguageID property for the results of any previous language detection.

The LanguageDetected property is set to True when the DetectLanguage method is called. To reevaluate the language of the specified text, you must first set the LanguageDetected property to False.

This example checks the active document to determine the language it’s written in and then displays the result.

With ActiveDocument.Range 
 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

Concepts

Other resources

Show:
© 2015 Microsoft