Language, Language$()

Syntax

Language Language$

Language$([Count])

Remarks

The Language statement identifies the selected text as being in a specific language. The proofing tools use dictionaries of the specified language on this text. Although the Language dialog box (Tools menu) lists language names in their English form, Language$ must be in the specified language and include any accented characters. For example, Italian must be specified as "Italiano" and French must be specified as "Français." For a list of valid foreign language names, see ToolsLanguage.

If Count is 0 (zero) or omitted, the Language$() function returns the language format of the first character of the selected text. If there is no selection, Language$() returns the language format of the character to the left of the insertion point.

If Count is greater than 0 (zero), Language$() returns the name of the language Count, where Count is the position of the language in an internal list of untranslated language names. Note that the list of untranslated language names does not match the list in the Language dialog box (Tools menu) because in the dialog box, language names are translated into English and sorted alphabetically. The Count argument is in the range 1 to CountLanguages().

Examples

These instructions show three different uses for the Language statement. The first marks the selection as British English, the second as whatever language is twelfth, and the third as No Proofing. The proofing tools skip over text marked as No Proofing.


Language "English (UK)"
Language Language$(12)
Language "0"

The following macro creates a two-column list in the active document showing all valid Language$(Count) instructions and the corresponding language names that each value of Count returns. The returned language names are all valid arguments for the Language statement.


Sub MAIN
For i = 1 To CountLanguages()
    If i > 1 Then InsertPara
    Insert "Language$(" + Right$(Str$(i), Len(Str$(i))-1) + ")" \
        + Chr$(9) + Language$(i)
Next
End Sub

See Also

CountLanguages(), ToolsLanguage