VBA - Replace filename

K

Kiwi User

Hi guys,

I'm just trying to create a little macro to search for the mergefield
filename (in any format) and replace with {filename \* lower \p \*
mergeformat}.

For some unknown reason it really doesn't like this. I've turned on codes,
different view, will find filename but won't replace. Then I have to loop it
through the sections.

Any help much appreciated in advance.
 
J

Jean-Guy Marcil

Kiwi User was telling us:
Kiwi User nous racontait que :
Hi guys,

I'm just trying to create a little macro to search for the mergefield
filename (in any format) and replace with {filename \* lower \p \*
mergeformat}.

For some unknown reason it really doesn't like this. I've turned on
codes, different view, will find filename but won't replace. Then I
have to loop it through the sections.

Any help much appreciated in advance.

Have you tried doing something with the Code property of the Field object?
The Code property can return a string which you can manipulate, such as
adding "\* lower \p \* mergeformat" to it.

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
[email protected]
Word MVP site: http://www.word.mvps.org
 
Top