Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
associates76[_2_] associates76[_2_] is offline
external usenet poster
 
Posts: 1
Default Section in the bullet and numbering


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
  #2   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

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

  #3   Report Post  
Posted to microsoft.public.word.docmanagement
associates76[_3_] associates76[_3_] is offline
external usenet poster
 
Posts: 1
Default Section in the bullet and numbering


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
  #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




Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
question on bullet and numbering Associates Microsoft Word Help 3 January 4th 08 09:59 AM
Sub-bullet character in numbering style livetohike Microsoft Word Help 8 September 11th 07 11:25 PM
Track Changes and Numbering or Bullet styles Sydney Microsoft Word Help 1 May 31st 06 12:42 AM
Bullet Point and Numbering Formatting BSK Page Layout 1 April 6th 06 07:26 PM
Auto Bullet & numbering feature?? Bob Newman New Users 1 June 27th 05 10:18 PM


All times are GMT +1. The time now is 05:36 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"