convert a numbered list to a multilevel list

  • Thread starter Thread starter abc
  • Start date Start date
A

abc

Hi all

I have started writing a document using a numbered list like

1. text
text
2. text
text
3. text
text

is there a way to convert that list to a multi-level list so that i can
have something like

1. text
text
1.1 text
text
2. text
text
3. text
text

?

Thanks!
 
How would any method know that your

2. Text

was to become

1.1 Text

and that

3. Text

was to become

2. Text

and so on?

Or, did you just give a bad example?

If your text is separated from the numbers by a tab stop and you associated
the numbering that you want to use with Heading styles

(See the following page of fellow MVP Shauna Kelly's website -
http://www.ShaunaKelly.com/word/numbering/OutlineNumbering.html

Running a macro containing the following code will convert the first level
of numbering to Heading 1 style

Dim drange As Range
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(FindText:="[0-9]{1,}.^9", Forward:=True, _
MatchWildcards:=True, Wrap:=wdFindStop, MatchCase:=False) = True
Set drange = Selection.Range
drange.Text = ""
drange.End = drange.Paragraphs(1).Range.End
drange.Style = "Heading 1"
Loop
End With

For the second level, replace

"[0-9]{1,}.^9"

with

"[0-9]{1,}.[0-9]{1,}.^9"

and the Heading 1 with Heading 2

and for the third level you would use

"[0-9]{1,}.[0-9]{1,}.[0-9]{1,}.^9"

For an explanation of what is being looked for, see the following page of
fellow MVP Graham Mayor's website

http://www.gmayor.com/replace_using_wildcards.htm

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
Hi,

Thanks for your answer.

I think I did not explain well what my scenario is:

I already have a Numbered List, that I created using the Numbered List
button (Word 2007).

So the numbers that appear at the beginning of some lines of my text are
automatically assigned by Word.

Whenever I press <ENTER> at the end of one automatically numbered line,
say (n) I get a new line numbered (n+1).

What I would like to do now is to convert the lines that are already
automatically numbered as a flat list, into what word calls a
"multilevel list", a list where I can create lines that are
automatically numbered as 1.1.1 1.1.2 etc.

Is there a way to convert the lines that are already numbered as flat
into multilevel. Even doing that on a line-by-line basis would be OK.

Example: I highlight numbered list line "1. INTRODUCTION" then do
something in Word that converts that line from item # 1 of a numbered
list into item # 1.0.0 of a multilevel list.

Is there a way to do that?

Thanks!
 
You'll need to create the multilevel list and link it to specific styles,
then apply the appropriate style to the subordinate members of the list.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org

abc said:
Hi,

Thanks for your answer.

I think I did not explain well what my scenario is:

I already have a Numbered List, that I created using the Numbered List
button (Word 2007).

So the numbers that appear at the beginning of some lines of my text are
automatically assigned by Word.

Whenever I press <ENTER> at the end of one automatically numbered line,
say (n) I get a new line numbered (n+1).

What I would like to do now is to convert the lines that are already
automatically numbered as a flat list, into what word calls a "multilevel
list", a list where I can create lines that are automatically numbered as
1.1.1 1.1.2 etc.

Is there a way to convert the lines that are already numbered as flat into
multilevel. Even doing that on a line-by-line basis would be OK.

Example: I highlight numbered list line "1. INTRODUCTION" then do
something in Word that converts that line from item # 1 of a numbered list
into item # 1.0.0 of a multilevel list.

Is there a way to do that?

Thanks!




How would any method know that your

2. Text

was to become

1.1 Text

and that

3. Text

was to become

2. Text

and so on?

Or, did you just give a bad example?

If your text is separated from the numbers by a tab stop and you
associated the numbering that you want to use with Heading styles

(See the following page of fellow MVP Shauna Kelly's website -
http://www.ShaunaKelly.com/word/numbering/OutlineNumbering.html

Running a macro containing the following code will convert the first
level of numbering to Heading 1 style

Dim drange As Range
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(FindText:="[0-9]{1,}.^9", Forward:=True, _
MatchWildcards:=True, Wrap:=wdFindStop, MatchCase:=False) = True
Set drange = Selection.Range
drange.Text = ""
drange.End = drange.Paragraphs(1).Range.End
drange.Style = "Heading 1"
Loop
End With

For the second level, replace

"[0-9]{1,}.^9"

with

"[0-9]{1,}.[0-9]{1,}.^9"

and the Heading 1 with Heading 2

and for the third level you would use

"[0-9]{1,}.[0-9]{1,}.[0-9]{1,}.^9"

For an explanation of what is being looked for, see the following page of
fellow MVP Graham Mayor's website

http://www.gmayor.com/replace_using_wildcards.htm
 
Back
Top