Hi!

I have to modify a very long (about 200 pages) document and go through all
the headings in it. When I'm using wdRefTypeHeading in the following code,
it only stores the first 10 of the top level headings. All the headings
after that aren't stored in myHeadings, i.e. 11, 11.1..

Dim myHeadings As Variant
myHeadings = docMacro.GetCrossReferenceItems(wdRefTypeHeading)

It doesn't help if I remove some headings between headings 1-10. So, what
could be wrong, is there a limit of 10 H1's in wdRefTypeHeading or what?

-Jarkko

Re: wdRefTypeHeading returning only 10 "Heading 1" headings by Cindy

Cindy
Wed Jan 07 11:32:21 CST 2004

Hi Jarkko,

I can't see the problem here, running a quick test with 15 Headings in a
document.

Are you only testing the one document? It's possible the document is
damaged, somehow, and that the VBA code can't "see" beyond a certain point.
Do you still have the problem in a new document?

Or might you be using the headings in a text box, or something else outside
the actual main body of the document?

If none of these thoughts apply, we'd need to know the version of Word
you're using, and see the code context in which the problem is occurring.

> I have to modify a very long (about 200 pages) document and go through all
> the headings in it. When I'm using wdRefTypeHeading in the following code,
> it only stores the first 10 of the top level headings. All the headings
> after that aren't stored in myHeadings, i.e. 11, 11.1..
>
> Dim myHeadings As Variant
> myHeadings = docMacro.GetCrossReferenceItems(wdRefTypeHeading)
>
> It doesn't help if I remove some headings between headings 1-10. So, what
> could be wrong, is there a limit of 10 H1's in wdRefTypeHeading or what?
>

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)