Class Language (Word VBA)

The class Language represents a language used for proofing or formatting in Microsoft Word. The Language object is a member of the Languages collection.

Set

To use a Language class variable it first needs to be instantiated, for example

Dim lng as Language
Set lng = Languages(Index:=1)

The following procedures can be used to set variables of type Language: Languages.Item and Application.Languages

For Each

Here is an example of processing the Language items in a collection.

Dim lng As Language
For Each lng In Languages
	
Next lng

Properties

ActiveGrammarDictionary returns a Dictionary object that represents the active grammar dictionary for the specified language.

Dim dictActiveGrammarDictionary As Dictionary
Set dictActiveGrammarDictionary = Languages(1).ActiveGrammarDictionary

ActiveHyphenationDictionary returns a Dictionary object that represents the active hyphenation dictionary for the specified language.

Dim dictActiveHyphenationDictionary As Dictionary
Set dictActiveHyphenationDictionary = Languages(1).ActiveHyphenationDictionary

ActiveSpellingDictionary returns a Dictionary object that represents the active spelling dictionary for the specified language.

Dim dictActiveSpellingDictionary As Dictionary
Set dictActiveSpellingDictionary = Languages(1).ActiveSpellingDictionary

ActiveThesaurusDictionary returns a Dictionary object that represents the active thesaurus dictionary for the specified language.

Dim dictActiveThesaurusDictionary As Dictionary
Set dictActiveThesaurusDictionary = Languages(1).ActiveThesaurusDictionary

DefaultWritingStyle returns or sets the default writing style used by the grammar checker for the specified language.

Languages(1).DefaultWritingStyle =

ID returns a number that identifies the specified language.

Dim wliID As WdLanguageID
wliID = Languages(1).ID

Name returns the name of the specified object.

Dim strName As String
strName = Languages(1).Name

NameLocal returns the name of a proofing tool language in the language of the user.

Dim strNameLocal As String
strNameLocal = Languages(1).NameLocal

Parent returns an object that represents the parent object of the specified Language object.

Dim objParent As Object
Set objParent = Languages(1).Parent

SpellingDictionaryType returns or sets the proofing tool type.

Languages(1).SpellingDictionaryType = wdGrammar

WritingStyleList returns a string array that contains the names of all writing styles available for the specified language.

Dim varWritingStyleList As Variant
varWritingStyleList = Languages(1).WritingStyleList

Languages.Count returns a Long that represents the number of languages in the collection.

Dim lngCount As Long
lngCount = Languages.Count

Languages.Parent returns an object that represents the parent object of the specified Languages object.

Dim objParent As Object
Set objParent = Languages.Parent