关于 word VBA的宏运行 输入文本的代码 急求 谢谢
答案:2 悬赏:40 手机版
解决时间 2021-03-03 12:40
- 提问者网友:浪荡绅士
- 2021-03-03 02:02
有一个固定的word表格,我想用自带的VBA 把 word中的字母 a,b,c...替换成我想要的东西 求源代码
最佳答案
- 五星知识达人网友:何以畏孤独
- 2021-03-03 03:14
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "x" ‘x为查找的内容
.Replacement.Text = "y" y为要替换成的内容
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchByte = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "x" ‘x为查找的内容
.Replacement.Text = "y" y为要替换成的内容
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchByte = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
全部回答
- 1楼网友:你哪知我潦倒为你
- 2021-03-03 04:34
subexample()dimmyobjectasobject'对于浮动式文本框控件setmyobject=activedocument.shapes(1).oleformat.objectmsgboxmyobject.text'对于嵌入式文本框控件setmyobject=activedocument.inlineshapes(1).oleformat.objectmsgboxmyobject.text'对于word的文本框图形(非控件)setmyobject=activedocument.shapes(1).textframe.textrangemsgboxmyobject.textendsub
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯