我有一个范围。在这个范围内是一些文字。我现在可以用vba检测某个样式 - 比方说标题1 - 是否在这个范围内使用?
答案 0 :(得分:0)
使用Selection.Find
方法
mySelection.Find.ClearFormatting
mySelection.Find.Style = ActiveDocument.Styles("Heading 1")
With mySelection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchByte = False
.CorrectHangulEndings = False
.HanjaPhoneticHangul = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = False
.MatchFuzzy = False
End With
mySelection.Find.Execute