Using Macro to Change case of text in merge

J

jonno

I'm trying to run a merge from Goldmine to word 2003, however the
fields I'm bringing in are all in UPPERCASE, is it possible to run a
macro that changes the fields to title case?

The fields look like:
{DDEAUTO GoldMine Data &Company \*CHARFORMAT }

I've tried the usual right click "edit field" and change the case in
the properties dialogue - but it isn't listed as an option.. Any help
appreciated.

Thanks,

Jon
 
D

Doug Robbins - Word MVP

I think that you are going to have to run a macro over the document created
by executing the merge to a new document. Here is the code that you would
use:

Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(findText:="[A-Z]{2,}", Forward:=True, _
MatchWildcards:=True, MatchCase:=True, Wrap:=wdFindStop) = True
Found = True
Selection.Range.Case = wdTitleWord
Selection.Collapse wdCollapseEnd
Loop
End With


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

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