搜索文本,将其替换为隐藏文本 [英] Search for text, replace it with hidden text
本文介绍了搜索文本,将其替换为隐藏文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在运行2010年的字样。 我正在尝试编写一个宏来查找"john"这个词的所有实例,并将其替换为"john",但隐藏了该文本。 我似乎无法解决这个问题。
I am running word 2010. I am trying to write a macro which finds all instances of the word 'john' and replaces it with 'john' but with that text hidden. I cant seem to get this working.
推荐答案
您好
以下是提示:
Sub Hide_John()
Selection.HomeKey wdStory, wdMove
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
Selection.Find.Replacement.Font.Hidden = True
With Selection.Find
.Text = "John"
.Replacement.Text = "John"
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = True
.MatchWholeWord = True
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
这篇关于搜索文本,将其替换为隐藏文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文