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
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 

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