styleref in msgbox

R

raj

I have styled my chapter head as "Chapter Title" and would like to display
the chapter head content using the msgbox. how to do this?

Thanks in advance,

Raj
 
R

Ravi \(newgen\)

Hi Raj,

Try with this code.
''''''
Dim p As Paragraph
For Each p In ActiveDocument.Paragraphs
If p.Range.Style = "Chapter Title" Then
MsgBox p.Range.Text
Exit For
End If
Next
''''''

-Ravi
 
Top