word 替换文本框

创建以下宏  

Dim mShape As Shape
Dim tmpString As String
For Each mShape In ActiveDocument.Shapes
If mShape.Type = msoTextBox Then
tmpString = mShape.TextFrame.TextRange.Text
mShape.TextFrame.TextRange.Text = Replace(tmpString, "查找内容", "替换内容")
End If
Next
End Sub

  

posted @ 2016-09-23 11:15  mybuilder  阅读(543)  评论(0编辑  收藏  举报