首页 > 代码库 > word 替换文本框

word 替换文本框

创建以下宏  

Dim mShape As ShapeDim tmpString As StringFor Each mShape In ActiveDocument.ShapesIf mShape.Type = msoTextBox ThentmpString = mShape.TextFrame.TextRange.TextmShape.TextFrame.TextRange.Text = Replace(tmpString, "查找内容", "替换内容")End IfNextEnd Sub

  

word 替换文本框