> When I already know a TOC item
> (MyDoc.TablesOfContents[1].Range.Paragraphs[1]), how can i select the
[quoted text clipped - 10 lines]
>
> Tomcat
Hi Tomcat
If the paeragraph has a PAGEREF field included (making the page number into
a hyperlink) then you can extract the bookmark from the Code property fo the
field. That bookmark makes the heading paragraph. If you want the range of
the body text below it, then get the bookmark of the following TOC entry
page number, and then get the range from the start of the current bookmark
to the start of the next.

Signature
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
tomcat - 07 Jan 2005 22:58 GMT
Thanks for reply, I could find the PageRef property in the paeragraph
object, I am using c#. any idea?
Jonathan West - 08 Jan 2005 01:34 GMT
> Thanks for reply, I could find the PageRef property in the paeragraph
> object, I am using c#. any idea?
Paragraph(n).Range.Fields(1).Code.Text
That property will give you the text of the field code, which will be
something like this
" PAGEREF _ToC3452435623 "
The second word is the name of the bookmark marking the heading in the body
of the document

Signature
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
tomcat - 08 Jan 2005 02:28 GMT