word设定段位使用的字体,边框,制表位和语言等格式是什么

来源:百度知道 编辑:UC知道 时间:2024/09/24 15:23:06

文档中的所有居中段落底部应用下边框。

For Each para In ActiveDocument.Paragraphs
If para.Alignment = wdAlignParagraphCenter Then
para.Borders(wdBorderBottom).LineStyle = wdLineStyleSingle
para.Borders(wdBorderBottom).LineWidth = wdLineWidth300pt
End If
Next para

下列示例将活动首段的格式设置为 24 磅、Arial 和倾斜。

Set myRange = ActiveDocument.Paragraphs(1).Range
With myRange.Font
.Bold = True
.Name = "Arial"
.Size = 24
End With

本示例在活动文档各段的 2 英寸处添加居中的制表位。InchesToPoints 方法用来将英寸转化为磅值。

With ActiveDocument.Paragraphs.TabStops
.Add Position:= InchesToPoints(2), Alignment:= wdAlignTabCenter
End With

本示例检查活动文档,以确定其所用的语言类型并显示检查结果。

With ActiveDocument
If .LanguageDetected = True Then
x = MsgBox("This document has already " _
& "been checked. Do you want to check " _
& &qu