Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Word
application.errors
conversions
docmanagement
drawing.graphics
formatting.longdocs
international
internet.assistant
mail
mailmerge.fields
menustoolbars
newusers
numbering
oleinterop
pagelayout
printingfonts
setup.networking
spelling.grammar
tables
vba.addins
vba.beginners
vba.customization
vba.general
vba.userforms
web.authoring
word6-7macros
word97vba
  
 
date: Thu, 10 Apr 2008 11:17:00 -0700,    group: microsoft.public.word.vba.beginners        back       


Skipping numbers in enumerated lists from VBScript/VBA   
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
date: Thu, 10 Apr 2008 11:17:00 -0700   author:   shaagerup

Re: Skipping numbers in enumerated lists from VBScript/VBA   
shaagerup wrote:
> 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.
-- 
.NET: It's About Trust!
 http://vfred.mvps.org
date: Thu, 10 Apr 2008 11:54:59 -0700   author:   Karl E. Peterson

Re: Skipping numbers in enumerated lists from VBScript/VBA   
"Karl E. Peterson" wrote:

> 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.. :-)
date: Fri, 11 Apr 2008 08:28:01 -0700   author:   shaagerup

Re: Skipping numbers in enumerated lists from VBScript/VBA   
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.

-- 
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup


"shaagerup"  wrote in message 
news:FBE1B50C-27B7-48CC-AD28-AF7A769E4A4C@microsoft.com...
> 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
date: Fri, 11 Apr 2008 18:42:12 +0100   author:   Jonathan West

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us