Find and Replace Macro

L

LaRana6261

Hello,
I need a macro for a .doc that will find certain text and replace it with
its corresponding value from a table of values.
Examples:
Text = s[32] cross reference "Record Name"
Text =s[33] cross reference "Record Address"

My table has about 190 record names which I need to replace everytime the
field "Code" is found. In the example above, s[32] will be replace by "record
name". can someone assist?

Thanks,
 
G

Graham Mayor

The following should work. It uses a two column table, without blank rows,
here saved as a document - D:\My Documents\Test\Changes.doc The document
name is not relevant, as long as you define it in the macro. Put the text to
be found in the first column and the replacement in the second column and
run the macro with the document to be edited active.

Sub ReplaceFromTableList()
Dim oChanges As Document, oDoc As Document
Dim oTable As Table
Dim oRng As Range
Dim rFindText As Range, rReplacement As Range
Dim i As Long
Dim sFname As String
sFname = "D:\My Documents\Test\Changes.doc"
Set oDoc = ActiveDocument
Set oRng = oDoc.Range
Set oChanges = Documents.Open(sFname)
Set oTable = oChanges.Tables(1)
oDoc.Activate
For i = 1 To oTable.Rows.Count
Set rFindText = oTable.Cell(i, 1).Range
rFindText.End = rFindText.End - 1
Set rReplacement = oTable.Cell(i, 2).Range
rReplacement.End = rReplacement.End - 1
With oRng.Find
.ClearFormatting
.Replacement.ClearFormatting
Do While .Execute(findText:=rFindText, _
MatchWholeWord:=True, _
MatchWildcards:=False, _
Forward:=True, _
Wrap:=wdFindContinue) = True
oRng.Text = rReplacement
Loop
End With
Next i
oChanges.Close wdDoNotSaveChanges
End Sub


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
L

LaRana6261

This is great! I can work with this!

Thank you,
--
EdV


Graham Mayor said:
The following should work. It uses a two column table, without blank rows,
here saved as a document - D:\My Documents\Test\Changes.doc The document
name is not relevant, as long as you define it in the macro. Put the text to
be found in the first column and the replacement in the second column and
run the macro with the document to be edited active.

Sub ReplaceFromTableList()
Dim oChanges As Document, oDoc As Document
Dim oTable As Table
Dim oRng As Range
Dim rFindText As Range, rReplacement As Range
Dim i As Long
Dim sFname As String
sFname = "D:\My Documents\Test\Changes.doc"
Set oDoc = ActiveDocument
Set oRng = oDoc.Range
Set oChanges = Documents.Open(sFname)
Set oTable = oChanges.Tables(1)
oDoc.Activate
For i = 1 To oTable.Rows.Count
Set rFindText = oTable.Cell(i, 1).Range
rFindText.End = rFindText.End - 1
Set rReplacement = oTable.Cell(i, 2).Range
rReplacement.End = rReplacement.End - 1
With oRng.Find
.ClearFormatting
.Replacement.ClearFormatting
Do While .Execute(findText:=rFindText, _
MatchWholeWord:=True, _
MatchWildcards:=False, _
Forward:=True, _
Wrap:=wdFindContinue) = True
oRng.Text = rReplacement
Loop
End With
Next i
oChanges.Close wdDoNotSaveChanges
End Sub


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>


LaRana6261 said:
Hello,
I need a macro for a .doc that will find certain text and replace it with
its corresponding value from a table of values.
Examples:
Text = s[32] cross reference "Record Name"
Text =s[33] cross reference "Record Address"

My table has about 190 record names which I need to replace everytime the
field "Code" is found. In the example above, s[32] will be replace by
"record
name". can someone assist?

Thanks,


.
 
G

Graham Mayor

You are welcome :)

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

LaRana6261 said:
This is great! I can work with this!

Thank you,
--
EdV


Graham Mayor said:
The following should work. It uses a two column table, without blank
rows,
here saved as a document - D:\My Documents\Test\Changes.doc The document
name is not relevant, as long as you define it in the macro. Put the text
to
be found in the first column and the replacement in the second column and
run the macro with the document to be edited active.

Sub ReplaceFromTableList()
Dim oChanges As Document, oDoc As Document
Dim oTable As Table
Dim oRng As Range
Dim rFindText As Range, rReplacement As Range
Dim i As Long
Dim sFname As String
sFname = "D:\My Documents\Test\Changes.doc"
Set oDoc = ActiveDocument
Set oRng = oDoc.Range
Set oChanges = Documents.Open(sFname)
Set oTable = oChanges.Tables(1)
oDoc.Activate
For i = 1 To oTable.Rows.Count
Set rFindText = oTable.Cell(i, 1).Range
rFindText.End = rFindText.End - 1
Set rReplacement = oTable.Cell(i, 2).Range
rReplacement.End = rReplacement.End - 1
With oRng.Find
.ClearFormatting
.Replacement.ClearFormatting
Do While .Execute(findText:=rFindText, _
MatchWholeWord:=True, _
MatchWildcards:=False, _
Forward:=True, _
Wrap:=wdFindContinue) = True
oRng.Text = rReplacement
Loop
End With
Next i
oChanges.Close wdDoNotSaveChanges
End Sub


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>


LaRana6261 said:
Hello,
I need a macro for a .doc that will find certain text and replace it
with
its corresponding value from a table of values.
Examples:
Text = s[32] cross reference "Record Name"
Text =s[33] cross reference "Record Address"

My table has about 190 record names which I need to replace everytime
the
field "Code" is found. In the example above, s[32] will be replace by
"record
name". can someone assist?

Thanks,


.
 
L

LaRana6261

Spoke too soon...

I am finding some issues where my table has the following values

L[1 STATE [1]
L[10 PROP STREET SUFFIX [10]

So when the macros looks for "L[10" it returns "STATE[1]". In other words,
it is not looking for an exact match as it is set by the macro
(MatchWholeWord:=True).
can this be fixed?

Also, how can I make the results in 'BOLD'

thanks,

--
EdV


Graham Mayor said:
You are welcome :)

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

LaRana6261 said:
This is great! I can work with this!

Thank you,
--
EdV


Graham Mayor said:
The following should work. It uses a two column table, without blank
rows,
here saved as a document - D:\My Documents\Test\Changes.doc The document
name is not relevant, as long as you define it in the macro. Put the text
to
be found in the first column and the replacement in the second column and
run the macro with the document to be edited active.

Sub ReplaceFromTableList()
Dim oChanges As Document, oDoc As Document
Dim oTable As Table
Dim oRng As Range
Dim rFindText As Range, rReplacement As Range
Dim i As Long
Dim sFname As String
sFname = "D:\My Documents\Test\Changes.doc"
Set oDoc = ActiveDocument
Set oRng = oDoc.Range
Set oChanges = Documents.Open(sFname)
Set oTable = oChanges.Tables(1)
oDoc.Activate
For i = 1 To oTable.Rows.Count
Set rFindText = oTable.Cell(i, 1).Range
rFindText.End = rFindText.End - 1
Set rReplacement = oTable.Cell(i, 2).Range
rReplacement.End = rReplacement.End - 1
With oRng.Find
.ClearFormatting
.Replacement.ClearFormatting
Do While .Execute(findText:=rFindText, _
MatchWholeWord:=True, _
MatchWildcards:=False, _
Forward:=True, _
Wrap:=wdFindContinue) = True
oRng.Text = rReplacement
Loop
End With
Next i
oChanges.Close wdDoNotSaveChanges
End Sub


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>


Hello,
I need a macro for a .doc that will find certain text and replace it
with
its corresponding value from a table of values.
Examples:
Text = s[32] cross reference "Record Name"
Text =s[33] cross reference "Record Address"

My table has about 190 record names which I need to replace everytime
the
field "Code" is found. In the example above, s[32] will be replace by
"record
name". can someone assist?

Thanks,
--
EdV


.


.
 
G

Graham Mayor

The bold part is easy . Immediately after the line
oRng.Text = rReplacement
add the line
oRng.Bold = True
The other part I am a little unclear about.
The macro finds the two strings correctly in my test document. However as
the macro tests each string separately from start to finish if you then
search for sat L[1 it will find that in both the strings, if the strings are
unchanged by the earlier replacement. You need to set your table so that
subsequent searches do not clash with those that have already gone.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>



LaRana6261 said:
Spoke too soon...

I am finding some issues where my table has the following values

L[1 STATE [1]
L[10 PROP STREET SUFFIX [10]

So when the macros looks for "L[10" it returns "STATE[1]". In other words,
it is not looking for an exact match as it is set by the macro
(MatchWholeWord:=True).
can this be fixed?

Also, how can I make the results in 'BOLD'

thanks,

--
EdV


Graham Mayor said:
You are welcome :)

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

LaRana6261 said:
This is great! I can work with this!

Thank you,
--
EdV


:

The following should work. It uses a two column table, without blank
rows,
here saved as a document - D:\My Documents\Test\Changes.doc The
document
name is not relevant, as long as you define it in the macro. Put the
text
to
be found in the first column and the replacement in the second column
and
run the macro with the document to be edited active.

Sub ReplaceFromTableList()
Dim oChanges As Document, oDoc As Document
Dim oTable As Table
Dim oRng As Range
Dim rFindText As Range, rReplacement As Range
Dim i As Long
Dim sFname As String
sFname = "D:\My Documents\Test\Changes.doc"
Set oDoc = ActiveDocument
Set oRng = oDoc.Range
Set oChanges = Documents.Open(sFname)
Set oTable = oChanges.Tables(1)
oDoc.Activate
For i = 1 To oTable.Rows.Count
Set rFindText = oTable.Cell(i, 1).Range
rFindText.End = rFindText.End - 1
Set rReplacement = oTable.Cell(i, 2).Range
rReplacement.End = rReplacement.End - 1
With oRng.Find
.ClearFormatting
.Replacement.ClearFormatting
Do While .Execute(findText:=rFindText, _
MatchWholeWord:=True, _
MatchWildcards:=False, _
Forward:=True, _
Wrap:=wdFindContinue) = True
oRng.Text = rReplacement
Loop
End With
Next i
oChanges.Close wdDoNotSaveChanges
End Sub


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>


Hello,
I need a macro for a .doc that will find certain text and replace it
with
its corresponding value from a table of values.
Examples:
Text = s[32] cross reference "Record Name"
Text =s[33] cross reference "Record Address"

My table has about 190 record names which I need to replace
everytime
the
field "Code" is found. In the example above, s[32] will be replace
by
"record
name". can someone assist?

Thanks,
--
EdV


.


.
 
L

LaRana6261

Thanks, ok the bold thing I almost had correctly... I'll fix.

On the other glitch, well "L[1" may repeat itself later in the document
(just like "L[10" ).
I wanted to make sure that the macro only looks for "L[1" event if it finds
it in "L[10" which is causing undesirable results. I guess I can manipulate
each 10th with a separate "prefix", but that may create confusion for the
user.

I also found that if I remove the "[" to say "L1" instead of "L[1" then Word
does find exact matches and does not confuse it with 'L10'. I may go this
way instead...

In any event, your macro is already saving me hundreds of keystrokes and
countless hours of work!

I appreciate it.






--
EdV


Graham Mayor said:
The bold part is easy . Immediately after the line
oRng.Text = rReplacement
add the line
oRng.Bold = True
The other part I am a little unclear about.
The macro finds the two strings correctly in my test document. However as
the macro tests each string separately from start to finish if you then
search for sat L[1 it will find that in both the strings, if the strings are
unchanged by the earlier replacement. You need to set your table so that
subsequent searches do not clash with those that have already gone.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>



LaRana6261 said:
Spoke too soon...

I am finding some issues where my table has the following values

L[1 STATE [1]
L[10 PROP STREET SUFFIX [10]

So when the macros looks for "L[10" it returns "STATE[1]". In other words,
it is not looking for an exact match as it is set by the macro
(MatchWholeWord:=True).
can this be fixed?

Also, how can I make the results in 'BOLD'

thanks,

--
EdV


Graham Mayor said:
You are welcome :)

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

This is great! I can work with this!

Thank you,
--
EdV


:

The following should work. It uses a two column table, without blank
rows,
here saved as a document - D:\My Documents\Test\Changes.doc The
document
name is not relevant, as long as you define it in the macro. Put the
text
to
be found in the first column and the replacement in the second column
and
run the macro with the document to be edited active.

Sub ReplaceFromTableList()
Dim oChanges As Document, oDoc As Document
Dim oTable As Table
Dim oRng As Range
Dim rFindText As Range, rReplacement As Range
Dim i As Long
Dim sFname As String
sFname = "D:\My Documents\Test\Changes.doc"
Set oDoc = ActiveDocument
Set oRng = oDoc.Range
Set oChanges = Documents.Open(sFname)
Set oTable = oChanges.Tables(1)
oDoc.Activate
For i = 1 To oTable.Rows.Count
Set rFindText = oTable.Cell(i, 1).Range
rFindText.End = rFindText.End - 1
Set rReplacement = oTable.Cell(i, 2).Range
rReplacement.End = rReplacement.End - 1
With oRng.Find
.ClearFormatting
.Replacement.ClearFormatting
Do While .Execute(findText:=rFindText, _
MatchWholeWord:=True, _
MatchWildcards:=False, _
Forward:=True, _
Wrap:=wdFindContinue) = True
oRng.Text = rReplacement
Loop
End With
Next i
oChanges.Close wdDoNotSaveChanges
End Sub


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>


Hello,
I need a macro for a .doc that will find certain text and replace it
with
its corresponding value from a table of values.
Examples:
Text = s[32] cross reference "Record Name"
Text =s[33] cross reference "Record Address"

My table has about 190 record names which I need to replace
everytime
the
field "Code" is found. In the example above, s[32] will be replace
by
"record
name". can someone assist?

Thanks,
--
EdV


.



.


.
 
G

Graham Mayor

If you want to be more specific in your searches, then you will need to
consider using wildcard strings (noting that in a wildcard string square
brackets have a particular significance and will need to be handled
correctly). You will need to change the section of the macro

Do While .Execute(findText:=rFindText, _
MatchWholeWord:=True, _
MatchWildcards:=False, _
Forward:=True, _
Wrap:=wdFindContinue) = True
to

Do While .Execute(findText:=rFindText, _
MatchWildcards:=True, _
Forward:=True, _
Wrap:=wdFindContinue) = True

You could then search for (say) L\[1[ ]
which will find "L[1 " but not the first part of "L[10"

See http://www.gmayor.com/replace_using_wildcards.htm


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

LaRana6261 said:
Thanks, ok the bold thing I almost had correctly... I'll fix.

On the other glitch, well "L[1" may repeat itself later in the document
(just like "L[10" ).
I wanted to make sure that the macro only looks for "L[1" event if it
finds
it in "L[10" which is causing undesirable results. I guess I can
manipulate
each 10th with a separate "prefix", but that may create confusion for the
user.

I also found that if I remove the "[" to say "L1" instead of "L[1" then
Word
does find exact matches and does not confuse it with 'L10'. I may go this
way instead...

In any event, your macro is already saving me hundreds of keystrokes and
countless hours of work!

I appreciate it.






--
EdV


Graham Mayor said:
The bold part is easy . Immediately after the line
oRng.Text = rReplacement
add the line
oRng.Bold = True
The other part I am a little unclear about.
The macro finds the two strings correctly in my test document. However as
the macro tests each string separately from start to finish if you then
search for sat L[1 it will find that in both the strings, if the strings
are
unchanged by the earlier replacement. You need to set your table so that
subsequent searches do not clash with those that have already gone.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>



LaRana6261 said:
Spoke too soon...

I am finding some issues where my table has the following values

L[1 STATE [1]
L[10 PROP STREET SUFFIX [10]

So when the macros looks for "L[10" it returns "STATE[1]". In other
words,
it is not looking for an exact match as it is set by the macro
(MatchWholeWord:=True).
can this be fixed?

Also, how can I make the results in 'BOLD'

thanks,

--
EdV


:

You are welcome :)

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

This is great! I can work with this!

Thank you,
--
EdV


:

The following should work. It uses a two column table, without
blank
rows,
here saved as a document - D:\My Documents\Test\Changes.doc The
document
name is not relevant, as long as you define it in the macro. Put
the
text
to
be found in the first column and the replacement in the second
column
and
run the macro with the document to be edited active.

Sub ReplaceFromTableList()
Dim oChanges As Document, oDoc As Document
Dim oTable As Table
Dim oRng As Range
Dim rFindText As Range, rReplacement As Range
Dim i As Long
Dim sFname As String
sFname = "D:\My Documents\Test\Changes.doc"
Set oDoc = ActiveDocument
Set oRng = oDoc.Range
Set oChanges = Documents.Open(sFname)
Set oTable = oChanges.Tables(1)
oDoc.Activate
For i = 1 To oTable.Rows.Count
Set rFindText = oTable.Cell(i, 1).Range
rFindText.End = rFindText.End - 1
Set rReplacement = oTable.Cell(i, 2).Range
rReplacement.End = rReplacement.End - 1
With oRng.Find
.ClearFormatting
.Replacement.ClearFormatting
Do While .Execute(findText:=rFindText, _
MatchWholeWord:=True, _
MatchWildcards:=False, _
Forward:=True, _
Wrap:=wdFindContinue) = True
oRng.Text = rReplacement
Loop
End With
Next i
oChanges.Close wdDoNotSaveChanges
End Sub


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>


message
Hello,
I need a macro for a .doc that will find certain text and replace
it
with
its corresponding value from a table of values.
Examples:
Text = s[32] cross reference "Record Name"
Text =s[33] cross reference "Record Address"

My table has about 190 record names which I need to replace
everytime
the
field "Code" is found. In the example above, s[32] will be
replace
by
"record
name". can someone assist?

Thanks,
--
EdV


.



.


.
 
L

LaRana6261

Thanks!
--
EdV


Graham Mayor said:
If you want to be more specific in your searches, then you will need to
consider using wildcard strings (noting that in a wildcard string square
brackets have a particular significance and will need to be handled
correctly). You will need to change the section of the macro

Do While .Execute(findText:=rFindText, _
MatchWholeWord:=True, _
MatchWildcards:=False, _
Forward:=True, _
Wrap:=wdFindContinue) = True
to

Do While .Execute(findText:=rFindText, _
MatchWildcards:=True, _
Forward:=True, _
Wrap:=wdFindContinue) = True

You could then search for (say) L\[1[ ]
which will find "L[1 " but not the first part of "L[10"

See http://www.gmayor.com/replace_using_wildcards.htm


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

LaRana6261 said:
Thanks, ok the bold thing I almost had correctly... I'll fix.

On the other glitch, well "L[1" may repeat itself later in the document
(just like "L[10" ).
I wanted to make sure that the macro only looks for "L[1" event if it
finds
it in "L[10" which is causing undesirable results. I guess I can
manipulate
each 10th with a separate "prefix", but that may create confusion for the
user.

I also found that if I remove the "[" to say "L1" instead of "L[1" then
Word
does find exact matches and does not confuse it with 'L10'. I may go this
way instead...

In any event, your macro is already saving me hundreds of keystrokes and
countless hours of work!

I appreciate it.






--
EdV


Graham Mayor said:
The bold part is easy . Immediately after the line
oRng.Text = rReplacement
add the line
oRng.Bold = True
The other part I am a little unclear about.
The macro finds the two strings correctly in my test document. However as
the macro tests each string separately from start to finish if you then
search for sat L[1 it will find that in both the strings, if the strings
are
unchanged by the earlier replacement. You need to set your table so that
subsequent searches do not clash with those that have already gone.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>



Spoke too soon...

I am finding some issues where my table has the following values

L[1 STATE [1]
L[10 PROP STREET SUFFIX [10]

So when the macros looks for "L[10" it returns "STATE[1]". In other
words,
it is not looking for an exact match as it is set by the macro
(MatchWholeWord:=True).
can this be fixed?

Also, how can I make the results in 'BOLD'

thanks,

--
EdV


:

You are welcome :)

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

This is great! I can work with this!

Thank you,
--
EdV


:

The following should work. It uses a two column table, without
blank
rows,
here saved as a document - D:\My Documents\Test\Changes.doc The
document
name is not relevant, as long as you define it in the macro. Put
the
text
to
be found in the first column and the replacement in the second
column
and
run the macro with the document to be edited active.

Sub ReplaceFromTableList()
Dim oChanges As Document, oDoc As Document
Dim oTable As Table
Dim oRng As Range
Dim rFindText As Range, rReplacement As Range
Dim i As Long
Dim sFname As String
sFname = "D:\My Documents\Test\Changes.doc"
Set oDoc = ActiveDocument
Set oRng = oDoc.Range
Set oChanges = Documents.Open(sFname)
Set oTable = oChanges.Tables(1)
oDoc.Activate
For i = 1 To oTable.Rows.Count
Set rFindText = oTable.Cell(i, 1).Range
rFindText.End = rFindText.End - 1
Set rReplacement = oTable.Cell(i, 2).Range
rReplacement.End = rReplacement.End - 1
With oRng.Find
.ClearFormatting
.Replacement.ClearFormatting
Do While .Execute(findText:=rFindText, _
MatchWholeWord:=True, _
MatchWildcards:=False, _
Forward:=True, _
Wrap:=wdFindContinue) = True
oRng.Text = rReplacement
Loop
End With
Next i
oChanges.Close wdDoNotSaveChanges
End Sub


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>


message
Hello,
I need a macro for a .doc that will find certain text and replace
it
with
its corresponding value from a table of values.
Examples:
Text = s[32] cross reference "Record Name"
Text =s[33] cross reference "Record Address"

My table has about 190 record names which I need to replace
everytime
the
field "Code" is found. In the example above, s[32] will be
replace
by
"record
name". can someone assist?

Thanks,
--
EdV


.



.



.


.
 

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