View Single Post
  #3   Report Post  
Posted to microsoft.public.word.docmanagement
abc[_2_] abc[_2_] is offline
external usenet poster
 
Posts: 20
Default convert a numbered list to a multilevel list

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!





Doug Robbins - Word MVP wrote:
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/numb...Numbering.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