L
low
HI:
Working on a word 2003 doc. I want to find in that document,
occurrence of every Chinese word on a list I prepared, replace them
one by one with their English corresponding word on the same list (on
the same list as the Chinese words, side by side).
I've copied pasted the following code from the macro editor in Word:
Sub test1()
'
' test1 Macro
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "$BCOJ}(B" /* how to replace this
"hard coded " value with a variable, taken from */
.Replacement.Text = "endroit " /* a file, with a given
address, say "C:\bilingualList.txt" ???*/
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchByte = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
Can someone tell me how to code the 2 commented line so that the macro
goes to the file, take the work one by one from the list and change
them?
I have no programing experience with VB, but do have some experience
with C and java. thanks.
Working on a word 2003 doc. I want to find in that document,
occurrence of every Chinese word on a list I prepared, replace them
one by one with their English corresponding word on the same list (on
the same list as the Chinese words, side by side).
I've copied pasted the following code from the macro editor in Word:
Sub test1()
'
' test1 Macro
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "$BCOJ}(B" /* how to replace this
"hard coded " value with a variable, taken from */
.Replacement.Text = "endroit " /* a file, with a given
address, say "C:\bilingualList.txt" ???*/
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchByte = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
Can someone tell me how to code the 2 commented line so that the macro
goes to the file, take the work one by one from the list and change
them?
I have no programing experience with VB, but do have some experience
with C and java. thanks.