Skipping numbers in enumerated lists from VBScript/VBA

S

shaagerup

Hello

I would like to be able to create a numbered list from VBScript/VBA, and
skip certain numbers in that list.

E.g.:
1. First insertion
2. Second insertion
6. Third insertion

From the object structure exposed by the ListParagraphs collection, it seems
that some "empty" list elements are inserted between 2. and 6., but I can't
find the property that hides/unhides them..

In the XML-format it seems to be caused by the <w:vanish/>-tag, but I would
much rather like to use your API than to handcode it with XML..

Is this possible, and if so, can any of you point me in the right direction?
I've been struggling with this for a couple of days now, and I will be very
grateful for a solution :)..

Best regards,
Søren
 
K

Karl E. Peterson

shaagerup said:
Hello

I would like to be able to create a numbered list from VBScript/VBA, and
skip certain numbers in that list.

E.g.:
1. First insertion
2. Second insertion
6. Third insertion

From the object structure exposed by the ListParagraphs collection, it seems
that some "empty" list elements are inserted between 2. and 6., but I can't
find the property that hides/unhides them..

In VB/A, you simply define enumerated constant values:

Public Enum MyValues
FirstValue = 1
SecondValue = 2
ThirdValue = 6
End Enum

Dunno the viability of this approach in VBS, because it's so untyped.
 
S

shaagerup

Karl E. Peterson said:
Dunno the viability of this approach in VBS, because it's so untyped.
--

Could you possibly give me a bigger code sample (or a link to one)? . In
that way, I might be able to translate it into something I can use through
the external COM API..

Maybe we misunderstood each other.. With "enumerated lists" I mean "numbered
lists" in word - not an ENUM.. :)
 
J

Jonathan West

Now I understand that you mean numbered lists, what you need to do is insert
a suitable LISTNUM field at the end of item 2 so that the next item is item
6

This in turn may require that you define your list styles based on a named
ListTemplate which you can then refer to in the LISTNUM field.
 

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