Dim app As New MSWord.Application
try
Dim fileName = "D:\问题\123.docx"
Dim doc As object = app.Documents.Open(fileName)
Dim item = "【图片】" '被替换的字符
Dim sel = app.Selection
sel .Find.ClearFormatting
With sel .Find
.Text = item
.Replacement.Text = user.name
.Forward = True
.Wrap = MSWord.WdFindWrap.wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchByte = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
sel.Find.Execute
Doc.save
catch ex As exception
msgbox(ex.message)
finally
app.Quit
End try