|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
139:你原附件太大了,我精简了一下,变成4页了,配合新C5宏测试一下吧!
C5 替换前的样子.rar
(7.76 KB, 下载次数: 1)
- Sub c5中文注释结尾加标点()
- '5、把中文注释语后面,没有任何标点符号的加上一个中文句号。
- Dim i As Paragraph
- For Each i In ActiveDocument.Paragraphs
- If i.Range Like "*[a-z]*'[一-﨩]*" Then
- i.Range.Font.Color = wdColorPink '粉红(可删除/注释)
- i.Range.Characters.Last.Select
- Selection.MoveStart unit:=wdCharacter, Count:=-1
- Do While Selection Like "[ 。:;,、!?”’…-]*"
- Selection.MoveStart unit:=wdCharacter, Count:=-1
- Loop
- If Selection Like "[一-﨩]*" Then
- i.Range.Font.Color = wdColorBlue '蓝色(可删除/注释)
- i.Range.Font.Underline = wdUnderlineSingle '下划线
- Selection.MoveEnd unit:=wdCharacter, Count:=-1
- If Len(Selection) = 1 Then
- Selection.InsertAfter Text:="。"
- Else
- Selection.MoveStart unit:=wdCharacter, Count:=1
- If Selection.Text <> "。" Then Selection.Text = "。"
- End If
- End If
- End If
- Next
- End Sub
复制代码 |
|