Hello Everyone,

I'm trying to automate a task. I want the user to select the original
text (example below), execute the macro and convert it to what looks
like in the reformatted example. The assumptions is that there will
never be more than 30 entries for any level of outline numbering. The
text is all plain text as well and all the paragraphs have no styles
associated with them. I've tried coding finding and replacing using
loops but was getting hung up on keeping the numbering together. Any
easy ideas on how to do this?

Original Text:
1. First Paragraph.
a. Sales Plan.
b. Strategy.
(1) Strategy 1.
(2) Strategy 2.
(3) Strategy 3.
c. Marketing Plan.
2. Second Paragraph.
a. Intent
b. Concept of Execution.
(1) Execution 1.
(2) Execution 2.
(3) Execution 3.

Reformatted Text:
1. First Paragraph.
1.a. Sales Plan.
1.b. Strategy.
1.b.(1) Strategy 1.
1.b.(2) Strategy 2.
1.b.(3) Strategy 3.
1.c. Marketing Plan.
2. Second Paragraph.
2.a. Intent
2.b. Concept of Execution.
2.b.(1) Execution 1.
2.b.(2) Execution 2.
2.b.(3) Execution 3.

Thanks for the help!
Terry Hagen

Re: Resequencing Paragraph Outline Numbering by Cindy

Cindy
Tue Aug 23 06:57:09 CDT 2005

Hi Hagentd@cox.net,

> 'm trying to automate a task. I want the user to select the original
> text (example below), execute the macro and convert it to what looks
> like in the reformatted example. The assumptions is that there will
> never be more than 30 entries for any level of outline numbering. The
> text is all plain text as well and all the paragraphs have no styles
> associated with them. I've tried coding finding and replacing using
> loops but was getting hung up on keeping the numbering together. Any
> easy ideas on how to do this?
>
Has the numbering been typed in manually, or generated using Words
AutoNumbering feature? And which version of Word?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :-)


Re: Resequencing Paragraph Outline Numbering by hagentd

hagentd
Tue Aug 23 20:38:46 CDT 2005

Hi Cindy,

It has been typed in manually in plain text so there are no styles
associated with it. I'm working in Word 2k.

Thanks!
Terry


Re: Resequencing Paragraph Outline Numbering by Klaus

Klaus
Tue Aug 23 21:46:42 CDT 2005

<hagentd@cox.net> wrote:
> Hi Cindy,
>
> It has been typed in manually in plain text so there are no styles
> associated with it. I'm working in Word 2k.


Hi Terry,

Find/Replace then would be pretty clumsy. You'd be better off with a loop
over all paragraphs
Dim paraLoop as Paragraph
For each paraLoop in ActiveDocument.Paragraphs
' ...
Next paraLoop

For each para, you'd try to detect a level 1, 2, or 3 number at the
beginning (perhaps using "Like").
You'd stow a detected number in one of three variables (one for each level),
and then replace the old short number with the new long number in level 2
and 3 paragraphs.

The whole thing might turn out rather simple if you have tabs after all the
numbers. If there aren't tabs, it might make sense to put them in first.
This could be done with wildcard replacements, say for level 3:
Find what: (^13\([0-9]\))[^32^s^t]{1,}
Replace with: \1^t

If you run into problems, post back!

Regards,
Klaus



Re: Resequencing Paragraph Outline Numbering by hagentd

hagentd
Sat Aug 27 22:04:51 CDT 2005

Thanks! That makes sense. I appreciate the help.


Re: Resequencing Paragraph Outline Numbering by hagentd

hagentd
Sat Aug 27 22:12:20 CDT 2005

Thanks! That makes sense. I appreciate the help.


Re: Resequencing Paragraph Outline Numbering by hagentd

hagentd
Sat Aug 27 22:12:46 CDT 2005

Thanks! That makes sense. I appreciate the help.