word vba 字号的设置与判断
Admin | 2016-5-14 6:02:16 | 被阅次数 | 10015
一、设置字号
Dim rngParagraph As Range
Set rngParagraph = ActiveDocument.Paragraphs(3).Range
With rngParagraph
.Bold = False
.ParagraphFormat.Alignment = wdAlignParagraphLeft
With .Font
.Name = "隶书"
.Size = 15
End With
End With
二、判断字号
If ActiveDocument.Paragraphs(3).Range.Font.Size = 18 Then
MsgBox "18号字体"
Else
MsgBox "非18号字体,而是:" & ActiveDocument.Paragraphs(3).Range.Font.Size
End If