word 如何选择样式为"标题 1"的文字
请参考:
Sub SelectAllHeading1()
ActiveDocument.Range(0, 0).Select
Selection.GoTo What:=wdGoToHeading, Which:=wdGoToFirst, Count:=1
WordBasic.SelectSimilarFormatting
End Sub
//======================================
Sub SelectAllHeading1()
ActiveDocument.Range(0, 0).Select
Selection.GoTo What:=wdGoToHeading, Which:=wdGoToFirst, Count:=1
WordBasic.SelectSimilarFormatting
End Sub
//======================================
Sub gisoracle1()
Dim firstChar As Range
Dim p As Paragraph
For Each p In ActiveDocument.Paragraphs
Set firstChar = p.Range.Words(1)
If Mid(firstChar.Style, 1, 4) = "标题 1" Then
'firstChar.Bold = True And
MsgBox firstChar & "_" & firstChar.Style
End If
Next
End Sub
浙公网安备 33010602011771号