|
本帖最后由 cuanju 于 2020-8-22 14:41 编辑
Sub dm5()
Rem 选择题的题目和选项连成一行
Application.ScreenUpdating = False
Rem 以下参考了413191246se老师的作品
'******************************
Dim i As Paragraph
With ActiveDocument
'真假回车符/手动换行符=>段落标记并删除空段
.Content.Find.Execute "[^13^11]{1,}", , , 1, , , , , , "^p", 2
'全选
.Select
'居中/两端对齐=>删除段落首尾空格(半角空格/全角空格/不间断空格/制表符)
CommandBars.FindControl(ID:=122).Execute
CommandBars.FindControl(ID:=123).Execute
End With
'******************************
ActiveDocument.Content.Find.Execute FindText:="^13([A-D][、..])", ReplaceWith:="\1", Replace:=wdReplaceAll, MatchWildcards:=True
Application.ScreenUpdating = True
End Sub
|
|