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
 

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.

Ask a Question

Top