A
andreas
Dear Experts:
Below code searches for the first occurrence of the built-in
paragraph style heading 1.
Is it also possible to check whether the heading 1 level is outline
numbered, such as
"1 Analysis" ?
Help is much appreciated. Thank you very much in advance.
Regards, Andreas
Sub SearchStyleHeading1
Set rng = ActiveDocument.range
With rng.Find
.Style = ActiveDocument.Styles(wdStyleHeading1)
' Search from Beginning of Document
.Forward = True
'Find only one occurrence
.Wrap = wdFindStop
.Format = True
If .Execute() Then
MsgBox " Heading 1 style in current document!"
End If
End With
End Sub
Below code searches for the first occurrence of the built-in
paragraph style heading 1.
Is it also possible to check whether the heading 1 level is outline
numbered, such as
"1 Analysis" ?
Help is much appreciated. Thank you very much in advance.
Regards, Andreas
Sub SearchStyleHeading1
Set rng = ActiveDocument.range
With rng.Find
.Style = ActiveDocument.Styles(wdStyleHeading1)
' Search from Beginning of Document
.Forward = True
'Find only one occurrence
.Wrap = wdFindStop
.Format = True
If .Execute() Then
MsgBox " Heading 1 style in current document!"
End If
End With
End Sub