[问题] word 2013 宏指令设定问题

楼主: spacewatch (@@)   2015-07-24 00:11:58
软件:office word
版本:2013
各位先进好,最近小弟在设定宏的时候有一些问题想请问一下该如何解决
┌─────────┐
│AAA aaaaa │
│BBB bbbb │
│CCC CCCCcccc │
└─────────┘
┌─────────┐
│AAA aaaaa │
│BBB vvvvv │
│CC ccc cccc │
└─────────┘
因为工作需要,常要用到删掉段落标示以及空格
之前在word 2007设定好后,都可以依照自己所选择的表格完成
但在word 2013要重新设定时,每当选择只跑上面的表格时,下方的表格也会跟着自己动
不知道是不是有哪里设定错误?
以下是直接把VBA码直接贴上来
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "^p"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchByte = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = " "
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchByte = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
作者: soyoso (我是耀宗)   2015-07-24 08:17:00
如以原文来看是否可以改为这样 https://goo.gl/ildgVL
楼主: spacewatch (@@)   2015-07-24 23:39:00
感谢soyoso大,我把wdFindAsk改成wdFindStop就正常了

Links booklink

Contact Us: admin [ a t ] ucptt.com