How to get the current number of the first heading in a section ?

D

Danny

I have one sourcefile.
I create a new document every time that the header changes in my source
document. Afterwards, I copy the whole section to my new document.
So the end result is that I get as many result documents as there are
sections with "header changes" in my source document.
This works very fine.
I have one problem, the numbering of my headings starts every time again
from "1".
I want that in the new documents that the numbering stays the same as in the
original.
I know I can use "Startat"-property to set the beginning of mij numbered
list. But I can't find a way to get the correct number of the heading in my
source document. How can I do that?

To explain my problem a little bit better, a short scheme:

Sourcefile:
<header1>
1. Heading1
1.1 Heading2
2. Heading1
<section-end new page>
<header2>
3. Heading1
3.1 Heading2
<section-end new page>
4 Heading1
.......

My current result:
resultfile 1
1. Heading1
1.1 Heading2
2. Heading1

resultfile2
1. Heading1
1.1. Heading2

resultfile3
1. Heading1


Desired result
resultfile 1
1. Heading1
1.1. Heading2
2. Heading1

resultfile2
3. Heading1
3.1. Heading2

resultfile3
4. Heading1
 
J

Jean-Guy Marcil

Danny was telling us:
Danny nous racontait que :
I have one sourcefile.
I create a new document every time that the header changes in my
source document. Afterwards, I copy the whole section to my new
document.
So the end result is that I get as many result documents as there are
sections with "header changes" in my source document.
This works very fine.
I have one problem, the numbering of my headings starts every time
again from "1".
I want that in the new documents that the numbering stays the same as
in the original.
I know I can use "Startat"-property to set the beginning of mij
numbered list. But I can't find a way to get the correct number of
the heading in my source document. How can I do that?

To explain my problem a little bit better, a short scheme:

Sourcefile:
<header1>
1. Heading1
1.1 Heading2
2. Heading1
<section-end new page>
<header2>
3. Heading1
3.1 Heading2
<section-end new page>
4 Heading1
......

My current result:
resultfile 1
1. Heading1
1.1 Heading2
2. Heading1

resultfile2
1. Heading1
1.1. Heading2

resultfile3
1. Heading1


Desired result
resultfile 1
1. Heading1
1.1. Heading2
2. Heading1

resultfile2
3. Heading1
3.1. Heading2

resultfile3
4. Heading1

Have you tried with something like:

MsgBox Selection.Range.ListFormat.ListString

???
 
D

Danny

Jean-Guy Marcil said:
Danny was telling us:
Danny nous racontait que :


Have you tried with something like:

MsgBox Selection.Range.ListFormat.ListString

???
--
______________________________
Jean-Guy Marcil
Montreal, Canada


It works! Thank you very much for the solution
 

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