Can I customize a find macro to search something with a variable middle?

N

njmike

I may not have posed my question very well in the subject line, so
here's what I'm trying to do.

Let's say I have an area of text in a document (Word 2003) that I want
to find, but it may not be the same every time. Here's and example of
a couple possible areas of text.

Area 1:
aaaaa
bbbbb
ccccc
zzzzz

Area 2:
aaaaa
mmmmm
nnnnn
zzzzz

As you can see in both areas, "aaaaa" will always start it and "zzzzz"
will always end it. What I would like to do is set up my macro to
find the entire section from a to z. Once selected, my macro will
type in some new text. There is no special formatting I have to worry
about and there are no tables or pictures in the area I'm searching
for - just text. Also, this area will only appear once per document.
It is very possible, however, that there may be section breaks
somewhere in the middle. I'm not sure if this would present a
problem.

I'm not new to macros, so the only part I need help with is how to
write it to search these sections from start to end, regardless of
what may be in the middle. I have everything else covered.

Thank you in advance,
Mike
 
E

Ed

Mike - Would it work if you set your Find to "aaaaa" and then use
MoveEndUntil "zzzzz"? That's a method I use when splitting a huge database
dump into separate documents.

HTH
Ed
 
N

njmike

Well, wasn't that an easy one to resolve?

That was exactly what I was looking for.

Thanks, guys.
- Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top