How to get the ListString or ListValue of a Header after a break?

L

Losts

All,

I have a syle set up with numbering and outlining. Generally, I believe it
is set up correctly. But when I try to insert a page break in my heading 1
level so that the heading apears immediately after the page break (I do not
want all heading 1 in a new page, only some), ListValue and ListString seems
to reset to "1" and "1." respectively. Interesting, the number displayed in
word is correct, its programmically that it returns the wrong figure.

i.e. If the 6th item of my outline level 1, I wish it to start on a new
page, I would insert a pagebreak on the 'left' of this heading. Therefore the
page would look like:

---Page Break---
6. Heading Title

(notice no space between the break and the title)

But when i select this header and get the listvalue and liststring values
through Selection.Paragraphs(1).Range.ListFormat.* , it returns "1" and "1."
despite displaying correctly in word.

So my questions are the following:
-Does anyone know why this is happening?
-If so, how would I be able to prevent this and/or get the correct
ListString value for this outline?

Some notes:
-This does not occur if I leave a space between the page break and heading.
-Once 'reset' I am unable to get the correct listvalue and liststring, even
if I insert a linebreak between the page break and header, remove all
formatings, and reapply my custom heading 1 style.
-I am using word 2003.

Any help or comments would be greatly appreciated.

Best regards,
-Losts
 
D

DaveLett

Hi Losts,
I cannot replicate your issue. However, did you try to insert your page
break by modifying the paragraph instead of inserting the manual page break?
Format>Paragraph>Line and Page Breaks tab>Page break before check box

It might solve your issue...then again it might not.


Dave
 
L

Losts

Hi Dave,

I have found a tutorial which more accurately describes the problem.
http://www.thedoctools.com/demos/demo_crossref_2.html and how to prevent it.

Slides 10 and 11 in particular describe how to reproduce the 'error'.
Generally, it seems to be caused because adding another break (paragraph or
page) makes the slection.paragraphs(1).* refer to this new row, (which has 0
or 1)ListVale and not the second which has the value I wish to reference.

The reason I mark it as an error is that this behavior, and incorrect
numbering still exists even after deleting this new row. (i.e, deleting the
new 'row')
Seems the bookmark/selection.paragraph.* stays stuck trying to refer to this
row above which has no numbering even after it has been deleted.

Unfortunetly, I believe there is no way to fix this, and only to prevent
this by using word correctly, i.e. creating new paragraphs from the ending of
the previous paragarph, and not the start of the next one.

Best regards,
-Losts
 

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