View Single Post
  #4   Report Post  
Posted to microsoft.public.word.docmanagement
Stefan Blom Stefan Blom is offline
external usenet poster
 
Posts: 8,428
Default Section in the bullet and numbering

Use the ListValue property to get the number assigned to a list item. For
example, consider the following list:

Article I. Paragraph text here.
Article II. Paragraph text here.

When the insertion point is inside the second item, the following code:

Debug.Print Selection.Range.ListFormat.ListValue

would print 2 (to the Immediate window of the Visual Basic Editor).

--
Stefan Blom
Microsoft Word MVP


"associates76" wrote in message
...

Hi Stefan,

Thank you for your reply.

From what i can understand from the article, it's not possible to keep
track of the numbering system in the outline numbering. I tested it by
using the following code

MsgBox Selection.Paragraphs(1).OutlineLevel -- this actually returns
the level number

and if i have the following

Section 1. Some texts -- it returns 1

1.1. Some texts -- it returns 2
some texts -- it returns 10
1.1.1. Some texts -- it returns 3


Whereas what i'm after is
Section 1. Some texts -- returns 1
Section 2. Some texts -- returns 2
and so on

I suppose what i really wanted done is not doable

Is there any better ways i can use to achieve my goal here? any
suggestions?

Thank you in advance







Stefan Blom;2700354 Wrote:
See http://word.mvps.org/faqs/numbering/liststring.htm.

--
Stefan Blom


"associates76" wrote:
-

Hi,

I wonder if i can get some helps here. In the bullets and numbering,
we
can choose the one with the number format "Section 1.".

My question here is whether there is a way to capture the number "1"
using VBA codes.

For example, if we're at Section 3. , the code will return 3.

I have tried to use the following code but to no avail.

Selection.Collapse Direction:=wdCollapseStart
MsgBox "The insertion point is in section " & _
Selection.Information(wdActiveEndSectionNumber)

It looks like it returns the page number.

I use office word 03.

Thank you in advance




--
associates76
-





--
associates76