Hi,
How do I search and rename a mergefield in word using Delphi 6? I can search
for the text in
the document and also find the field using
word.ActiveDocument.Fields.item(1).select
but how do I rename it and carry on searching through the doc to find and
rename more fields??
Thanks
J
Cindy M -WordMVP- - 12 Nov 2003 17:17 GMT
Hi J,
> How do I search and rename a mergefield in word using Delphi 6? I can search
> for the text in
[quoted text clipped - 4 lines]
> but how do I rename it and carry on searching through the doc to find and
> rename more fields??
Easiest would probably be to modify the fields' .Code property. I might use
For Each fld in ActiveDocument.Fields
If fld.Type = wdFieldMergefield
'note: check the wd as I typed from memory
fld.Code = "Mergefield " & szNewName
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
http://www.mvps.org/word
This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)