ActiveWritingStyle Property

Microsoft Word Visual Basic

Show All

ActiveWritingStyle Property

       

Returns or sets the writing style for a specified language in the specified document. Read/write String.

Note   The WritingStyleList property returns an array of the names of the available writing styles.

expression.ActiveWritingStyle(LanguageID)

expression   Required. An expression that returns a Document object.

LanguageID   Required Variant. The language to set the writing style for in the specified document. Can be either a string or one of the following WdLanguageID constants.

WdLanguageID can be one of these WdLanguageID constants.
wdAfrikaans
wdAlbanian
wdArabic
wdArabicAlgeria
wdArabicBahrain
wdArabicEgypt
wdArabicIraq
wdArabicJordan
wdArabicKuwait
wdArabicLebanon
wdArabicLibya
wdArabicMorocco
wdArabicOman
wdArabicQatar
wdArabicSyria
wdArabicTunisia
wdArabicUAE
wdArabicYemen
wdArmenian
wdAssamese
wdAzeriCyrillic
wdAzeriLatin
wdBasque
wdBelgianDutch
wdBelgianFrench
wdBengali
wdBosniaHerzegovina
wdBrazilianPortuguese
wdBulgarian
wdBurmese
wdByelorussian
wdCatalan
wdChineseHongKong
wdChineseMacao
wdChineseSingapore
wdCroatian
wdCzech
wdDanish
wdDutch
wdEnglishAUS
wdEnglishBelize
wdEnglishCanadian
wdEnglishCaribbean
wdEnglishIreland
wdEnglishJamaica
wdEnglishNewZealand
wdEnglishPhilippines
wdEnglishSouthAfrica
wdEnglishTrinidad
wdEnglishUK
wdEnglishUS
wdEnglishZimbabwe
wdEstonian
wdFaeroese
wdFarsi
wdFinnish
wdFrench
wdFrenchCameroon
wdFrenchCanadian
wdFrenchCotedIvoire
wdFrenchLuxembourg
wdFrenchMali
wdFrenchMonaco
wdFrenchReunion
wdFrenchSenegal
wdFrenchWestIndies
wdFrenchZaire
wdFrisianNetherlands
wdGaelicIreland
wdGaelicScotland
wdGalician
wdGeorgian
wdGerman
wdGermanAustria
wdGermanLiechtenstein
wdGermanLuxembourg
wdGreek
wdGujarati
wdHebrew
wdHindi
wdHungarian
wdIcelandic
wdIndonesian
wdItalian
wdJapanese
wdKannada
wdKashmiri
wdKazakh
wdKhmer
wdKirghiz
wdKonkani
wdKorean
wdLanguageNone
wdLao
wdLatvian
wdLithuanian
wdLithuanianClassic
wdMacedonian
wdMalayalam
wdMalayBruneiDarussalam
wdMalaysian
wdMaltese
wdManipuri
wdMarathi
wdMexicanSpanish
wdMongolian
wdNepali
wdNoProofing
wdNorwegianBokmol
wdNorwegianNynorsk
wdOriya
wdPolish
wdPortuguese
wdPunjabi
wdRhaetoRomanic
wdRomanian
wdRomanianMoldova
wdRussian
wdRussianMoldova
wdSamiLappish
wdSanskrit
wdSerbianCyrillic
wdSerbianLatin
wdSesotho
wdSimplifiedChinese
wdSindhi
wdSlovak
wdSlovenian
wdSorbian
wdSpanish
wdSpanishArgentina
wdSpanishBolivia
wdSpanishChile
wdSpanishColombia
wdSpanishCostaRica
wdSpanishDominicanRepublic
wdSpanishEcuador
wdSpanishElSalvador
wdSpanishGuatemala
wdSpanishHonduras
wdSpanishModernSort
wdSpanishNicaragua
wdSpanishPanama
wdSpanishParaguay
wdSpanishPeru
wdSpanishPuertoRico
wdSpanishUruguay
wdSpanishVenezuela
wdSutu
wdSwahili
wdSwedish
wdSwedishFinland
wdSwissFrench
wdSwissGerman
wdSwissItalian
wdTajik
wdTamil
wdTatar
wdTelugu
wdThai
wdTibetan
wdTraditionalChinese
wdTsonga
wdTswana
wdTurkish
wdTurkmen
wdUkrainian
wdUrdu
wdUzbekCyrillic
wdUzbekLatin
wdVenda
wdVietnamese
wdWelsh
wdXhosa
wdZulu

Remarks

Some of the constants listed above may not be available to you, depending on the language support (U.S. English, for example) that you’ve selected or installed.

Example

This example sets the writing style used for French, German, and U.S. English for the active document. You must have the grammar files installed for French, German, and U.S. English to run this example.

With ActiveDocument
    .ActiveWritingStyle(wdFrench) = "Commercial"
    .ActiveWritingStyle(wdGerman) = "Technisch/Wiss"
    .ActiveWritingStyle(wdEnglishUS) = "Technical"
End With

This example returns the writing style for the language of the selection.

Sub WhichLanguage()
    Dim varLang As Variant

    varLang = Selection.LanguageID
    MsgBox ActiveDocument.ActiveWritingStyle(varLang)
End Sub