Hi,
I'd like to translate an export from a Dutch program into English. Luckily most text are just words instead of sentences. First I recorded my steps with 'find and replace' then I copied the code for all other words to be translated. Unfortunately after tens of words the code becomes messy. I've read the variable Collection would do the trick.
I tried to write this:
Dim Coll As New Collection
Coll.Add "Report", "Rapport"
Coll.Add "Version", "Versie"
'Coll.Add many many other words
For i = 1 To Coll.Count
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = Coll(i)
.Replacement.Text = Coll(.Key)
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = True
.MatchWholeWord = True
End With
Selection.Find.Execute Replace:=wdReplaceAll
Next i
I think the problem lies within .Key but can't figure out what I'm doing wrong here. If I write
the popup translates it into English and shows "Version". Why isn't this working in the replacement text?
Thank you in advance,
Erik
Bookmarks