View Single Post
  #5   Report Post  
Posted to microsoft.public.word.docmanagement
Fuzzhead
 
Posts: n/a
Default LISTNUM & Wildcards

Jay,

I was out of the office for a few days. THank you for your help. I tried it
first thing this morning and It worked great.

I have one other question about numbering. Once I change my Listnum XX \l 1
to Heading 1 can you do the following?

If Heading 1 is less than 4.0 use Heading 2 on Listnum \l 2 else Listnum \l
2 equals Heading 4.

Or do I have to pick one or the other and go back and manually change the
ones that are wrong?

Again thanks for all your help.

Larry



"Jay Freedman" wrote:

OK, I was thrown off by your first post having \l 1 in all the examples. But
you still don't need wildcards if the XX in all the fields really are two
digits. To change all the level-1 listnums to Heading 1 style, use the
search expression

^d LISTNUM ^#^# \l 1

and the replace expression

^&

with the Heading 1 style chosen (I assume you know how to use the More and
Format buttons in the dialog to set that). Then click Replace All. Repeat
with \l 2 and Heading 2; \l 3 and Heading 3.

If the XX might be either one digit or two, then you have a choice: You can
do two replacements for each level, one with a single ^# and one with ^#^#;
or you can do one wildcard replacement with the search expression

LISTNUM [0-9]{1,2} \\l 1

(notice that for a wildcard search you have to use two backslashes to match
one backslash).

In either case, you have to have field codes displayed.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

Fuzzhead wrote:
I guess I did not explain myself very well. I am tying LISTNUM'S to
Headings. So I have LISTNUM 40 \l 1, LISTNUM 40 \l 2 and LISTNUM 40
\l 3 or the 40's could be 39, 41 or 29 as examples. The "LISTNUM XX
\l 1" are being replaced by Heading 1. The "LISTNUM XX \l 2" are
being replaced by Heading 2 and "LISTNUM XX \l 3" are being replaced
by Heading 3. I want to write a macro that would only look at the "\l
1" or the "\l 2" in the LISTNUM and based on it would replace it with
Heading 1, 2 or 3. Can this be done?

"Jay Freedman" wrote:

You don't need a wildcard. First press Alt+F9 so all the field codes
are visible. Then use the following search expression:

^d LISTNUM

(note the space after the d). That will find any LISTNUM field.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.

On Thu, 11 May 2006 15:03:01 -0700, Fuzzhead
wrote:

Can you insert wildcards inside of a LISTNUM to find all the
different styles in the document? Examples are as follows:

{LISTNUM 23 \l 1}
{LISTNUM 40 \l 1}
{LISTNUM 41 \l 1}