toc

T

tomcat

Is it possible to retrieve TOC info? I want to know how many first
level TOC item and how many second level TOC item my document has. and
is it possible to select base on the TOC item?

thanks

Tomcat
 
W

Word Heretic

G'day "tomcat" <[email protected]>,

ActiveDocument.TablesOfContent(1) gives you the range of the first
TOC. Each paragraph in this range then has a style suffixed with the
level, eg TOC 1, TOC 2 etc

Steve Hudson - Word Heretic

steve from wordheretic.com (Email replies require payment)
Without prejudice


tomcat reckoned:
 
T

tomcat

thanks for answering my question.
but the TOC bookmark doesn't tell me the structure of the TOC. For
Example, if I have a TOC like

Section 1
-- Section 1 - subSection 1
-- Section 2 - subSection 2
---- Sesction 2 - subSection 2 - detail -1
Section 2
-- Section 2 - subSection 1
I need to programmatically find out that I have two top level items
("section 1" and "section 2") and first top level item
("section 1") has two second level items which are "Section 1 -
subSection 1" and "Section 2 - subSection 2 " can it be done?
 
W

Word Heretic

G'day "tomcat" <[email protected]>,

Yes, by using those styles.

Eg

If toc1 then
? count
count=0
else
count =count +1
end if

Steve Hudson - Word Heretic

steve from wordheretic.com (Email replies require payment)
Without prejudice


tomcat reckoned:
 

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