dear macropod
the senario, that in excel file A: find B: replace
macro run once open .doc file errowr occurs
curser in .doc file not highlite any text
i tried your suggested code with and without .clearFormatting
am i need to run it in office 2010 or higher?
Code:
With wdDoc.Range
With .Find
.ClearFormatting
.format = true
.Replacement.ClearFormatting
.format = true
.MatchCase = True
.Wrap = wdFindContinue
'Set font name
.Font.Name = "Tahoma"
.Text = Split(xlFList, "|")(i)
.Replacement.Font.Name = "Times new roman"
.Replacement.Text = Split(xlRList, "|")(i)
' Debugger runtime errowr in below line: '
.Execute Replace:=wdReplaceAll
End With
End With
thanks very much