|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
本帖最后由 duquancai 于 2019-2-24 12:20 编辑
你不仅仅是 “首行缩进2字符就是不变”的问题,关于查找部分 也是考虑 不全面。。。。。- Sub mxFind()
- Dim re As Object
- Set re = CreateObject("VBScript.Regexp")
- re.Pattern = "^附件\d{0,3}\r"
- With ActiveDocument.Content.Find
- Do While .Execute("<附件", , , -1)
- With .Parent
- If re.test(.Paragraphs(1).Range.Text) Then
- .Paragraphs(1).Range.Font.Name = "黑体"
- Call my_Format(.ParagraphFormat)
- End If
- End With
- Loop
- End With
- End Sub
- Sub my_Format(ByRef my_Paragraph As Object)
- With my_Paragraph
- .LeftIndent = 0
- .RightIndent = 0
- .FirstLineIndent = 0
- .CharacterUnitLeftIndent = 0
- .CharacterUnitRightIndent = 0
- .CharacterUnitFirstLineIndent = 0
- .LeftIndent = 0
- .RightIndent = 0
- .FirstLineIndent = 0
- .CharacterUnitLeftIndent = 0
- .CharacterUnitRightIndent = 0
- .CharacterUnitFirstLineIndent = 0
- End With
- End Sub
复制代码 |
评分
-
3
查看全部评分
-
|