Hi. I'm having problems working with listgalleries in MS Word.
I'm using a OLE object on my VB application to where I'll open a existing MS Word doc using the InsertFile method. This document has a numbered list, and I will import it to the OLE object. So far so good.
Then I'll need to write to the OLE Object, creating another numbered list that should continue the numbering of the previous one.
the final doc should be something like:
'Doc I get with .InsertFile
1. Something
1.1. Something else
1.2. .....
2. ......
3. ........
'Now from now on it will be writen by code
4. Write this witgh code
4.1. .....
5. .......
The thing is... I can't figure how to continue from the existing list... It will allways start by 1 and not by 4.
I'm doing:
Set rng = ActiveDocument.Range
rng.Collapse wdCollapseEnd
rng.ParagraphFormat.Style = "Normal"
rng.InsertParagraphAfter
rng.ListFormat.ApplyListTemplate ListTemplate:=ListGalleries(wdOutlineNumberGallery).ListTemplates(2), continuePreviousList:=True
Shouldn't this be enough? It seems I'm missing something since with this code I'll get
1....
2....
3....
1....
2....
It will create a new list. And I really don't know how to correct this, maybe someone can help me out.
Thanks in Advance
I'm using a OLE object on my VB application to where I'll open a existing MS Word doc using the InsertFile method. This document has a numbered list, and I will import it to the OLE object. So far so good.
Then I'll need to write to the OLE Object, creating another numbered list that should continue the numbering of the previous one.
the final doc should be something like:
'Doc I get with .InsertFile
1. Something
1.1. Something else
1.2. .....
2. ......
3. ........
'Now from now on it will be writen by code
4. Write this witgh code
4.1. .....
5. .......
The thing is... I can't figure how to continue from the existing list... It will allways start by 1 and not by 4.
I'm doing:
Set rng = ActiveDocument.Range
rng.Collapse wdCollapseEnd
rng.ParagraphFormat.Style = "Normal"
rng.InsertParagraphAfter
rng.ListFormat.ApplyListTemplate ListTemplate:=ListGalleries(wdOutlineNumberGallery).ListTemplates(2), continuePreviousList:=True
Shouldn't this be enough? It seems I'm missing something since with this code I'll get
1....
2....
3....
1....
2....
It will create a new list. And I really don't know how to correct this, maybe someone can help me out.
Thanks in Advance