全部显示

ActiveWritingStyle 属性

       

返回或设置指定文档中指定语言的写作风格。String 类型,可读写。

注意   WritingStyleList 属性返回一个所有可用的写作风格名称的数组。

expression.ActiveWritingStyle(LanguageID)

expression   必需。该表达式返回一个 Document 对象。

LanguageID   Variant 类型,必需。在指定文档中要设置写作风格的语言。可以是一个字符串或下列 WdLanguageID 常量之一。

说明

由于您选择或安装的语言支持不同,例如,英语(美国),上述部分常量可能无法使用。

示例

本示例设置活动文档中法语、德语和美国英语的写作风格。若要运行本示例,必须安装法语、德语和美国英语的语法文件。

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

本示例返回所选内容的语言的写作风格。

Sub WhichLanguage()
    Dim varLang As Variant

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