Document.ActiveWritingStyle property (Word)
Returns or sets the writing style for a specified language in the specified document. Read/write String.
Syntax
expression. ActiveWritingStyle
( _LanguageID_
)
expression Required. A variable that represents a Document object.
Parameters
Name | Required/Optional | Data type | Description |
---|---|---|---|
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. Some of the WdLanguageID constants may not be available to you, depending on the language support (U.S. English, for example) that you have selected or installed. |
Remarks
The WritingStyleList property returns an array of the names of the available writing styles.
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
See also
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.