T
Thomas M
Word 2000
I have the need for a macro that can find two text strings, and will
always find whichever one comes next. Basically, my data looks like
this:
Blah blah blah
Blah blah blah
Blah blah blah
MIN/W303956
Blah blah blah
Blah blah blah
Blah blah blah
--------------
Blah blah blah
Blah blah blah
Blah blah blah
Blah blah blah
NIC/W874265139
Blah blah blah
Blah blah blah
--------------
Blah blah blah
MIN/W545186
Blah blah blah
Blah blah blah
Blah blah blah
--------------
The strings I need to find are "MIN/" and "NIC/". These are fields from
a database, and the slash separates the field name from the data. I have
to find these fields in order--I can't just find all the MIN/ fields and
then all the NIC/ fields. So the macro would need to find the first
MIN/, then find the NIC/, then find the second MIN/.
Is there a way to have Word search for two text values at the same time,
and highlight whichever one it finds first? If not, what would be the
best way of going about this task?
I had the idea that maybe I could find all the MIN fields first, and
write the cursor location of each to an array, then find all the NIC
fields and write those cursor locations to the same array, then sort the
array by cursor location so that Word to go to each one in turn.
However, I have no idea how to do that!
--Tom
I have the need for a macro that can find two text strings, and will
always find whichever one comes next. Basically, my data looks like
this:
Blah blah blah
Blah blah blah
Blah blah blah
MIN/W303956
Blah blah blah
Blah blah blah
Blah blah blah
--------------
Blah blah blah
Blah blah blah
Blah blah blah
Blah blah blah
NIC/W874265139
Blah blah blah
Blah blah blah
--------------
Blah blah blah
MIN/W545186
Blah blah blah
Blah blah blah
Blah blah blah
--------------
The strings I need to find are "MIN/" and "NIC/". These are fields from
a database, and the slash separates the field name from the data. I have
to find these fields in order--I can't just find all the MIN/ fields and
then all the NIC/ fields. So the macro would need to find the first
MIN/, then find the NIC/, then find the second MIN/.
Is there a way to have Word search for two text values at the same time,
and highlight whichever one it finds first? If not, what would be the
best way of going about this task?
I had the idea that maybe I could find all the MIN fields first, and
write the cursor location of each to an array, then find all the NIC
fields and write those cursor locations to the same array, then sort the
array by cursor location so that Word to go to each one in turn.
However, I have no idea how to do that!
--Tom