卡饭网 > word > 正文

vba判断WORD字体是否是粗体

来源:本站整理 作者:梦在深巷 时间:2015-03-12 14:24:10

使用下面的代码,你就可以判断WORD内容是否使用了粗体的字形。

Dim doc As Document

Dim objWD As Word.Application

Set objWD = CreateObject("Word.Application")

Set doc = objWD.Documents.Open("C:/MyWord.doc")

If doc.Paragraphs(1).Range.Font.Bold = -1 Then

MsgBox"没有使用粗体''

else

MsgBox"已使用了粗体''

End If

相关推荐