Re: One more TOC question by Jonathan
Jonathan
Fri Jan 07 16:27:32 CST 2005
"tomcat" <cn_tomcat@hotmail.com> wrote in message
news:1105135507.200117.47040@f14g2000cwb.googlegroups.com...
> When I already know a TOC item
> (MyDoc.TablesOfContents[1].Range.Paragraphs[1]), how can i select the
> corespending content in the document?
>
> What I am trying to do is that I have a TOC like:
>
> Section 1
> -- Section 1.1
> -- Section 1.2
>
> I need to copy the part of the document linked to the Section 1.2.
> thanks for help
>
> 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.
--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup