Sub FindStyle
Dim strFound as String
With Selection.Find
.ClearFormatting
.Format = True
.Forward = True
.Style = "Header 1"
.Text = ""
.Execute
End With
if Selection.Find.Found then strFound = Selection.Text
End Sub
This captures the text of the named style into a string variable (strFound)
to do with what you will.
HTH and have a great day!
Steve Lang
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.