Word 2010 - VBA在每个数字前添加空行 [英] Word 2010 - VBA to add blank line before every number
本文介绍了Word 2010 - VBA在每个数字前添加空行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Hello all,
VBA可以在文档中的每个整数之前插入一个空行吗? 那么每个整数和后续文本都会被左对齐吗?
谢谢!
解决方案
您可以执行通配符搜索<([0-9])并替换为^ p \1
在VBA中:
Sub InsertBlankBeforeNumber()
With ActiveDocument.Content.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text =" ≤([0-9])"
.Replacement.Text =" ^ p\1"
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
。执行替换:= wdReplaceAll
以
End Sub结束
Hello all,
Can VBA insert a blank line before every integer in a document? So that each integer, and following text, would be left justified?
Thank you!
解决方案
You can perform a wildcard search for <([0-9]) and replace with ^p\1
In VBA:
Sub InsertBlankBeforeNumber() With ActiveDocument.Content.Find .ClearFormatting .Replacement.ClearFormatting .Text = "<([0-9])" .Replacement.Text = "^p\1" .Forward = True .Wrap = wdFindStop .Format = False .MatchCase = False .MatchWholeWord = False .MatchAllWordForms = False .MatchSoundsLike = False .MatchWildcards = True .Execute Replace:=wdReplaceAll End With End Sub
这篇关于Word 2010 - VBA在每个数字前添加空行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文