- Sub aa试卷选项_纵向排列_插入文字()
- With ActiveDocument
- '回车符/手动换行符=>段落标记
- .Content.Find.Execute "[^13^11]", , , 1, , , , , , "^p", 2
- '删除所有域
- .Fields.Unlink
- '列表编号/LISTNUM域转文本
- .ConvertNumbersToText
- '半角括号转全角
- With .Content.Find
- .Execute "(", , , , , , , , , "(", 2
- .Execute ")", , , , , , , , , ")", 2
- End With
- '全角数字转半角
- With .Content.Find
- .ClearFormatting
- .Text = "^13[0-90-9]@[、..]"
- .Forward = True
- .MatchWildcards = True
- Do While .Execute
- With .Parent
- .Characters.Last.Text = "."
- .CharacterWidth = wdWidthHalfWidth
- .Start = .End
- End With
- Loop
- End With
- With .Content.Find
- .Parent.InsertBefore Text:=vbCr
- .Execute "([!^13])([ABCDE])[..、]", , , 1, , , , , , "\1^p\2.", 2
- .Execute "([^13])([ABCDE])[..、]", , , 1, , , , , , "\1\2.", 2
- .Execute "([^13])([0-9]@)[..、]", , , 1, , , , , , vbCr & vbCr & "######" & vbCr & "【题型:单选】\1\2.〖题干〗:", 2
- End With
- '''以下加粗部分可以屏蔽!
- '''
- '查找和替换(加粗/黑体)
- With .Content.Find
- .ClearFormatting
- .Text = "题型:单选"
- With .Replacement
- .ClearFormatting
- .Font.Bold = True
- .Font.Name = "黑体" '本行代码可删除!
- End With
- .Execute , Format:=True, Replace:=wdReplaceAll
- End With
- '''
- '查找和替换(加粗/黑体)
- With .Content.Find
- .ClearFormatting
- .Text = "〖题干〗:"
- With .Replacement
- .ClearFormatting
- .Font.Bold = True
- .Font.Name = "黑体" '本行代码可删除!
- End With
- .Execute , Format:=True, Replace:=wdReplaceAll
- End With
- '''
- '查找和替换(加粗/黑体)
- With .Content.Find
- .ClearFormatting
- .Text = "######"
- With .Replacement
- .ClearFormatting
- .Font.Bold = True
- .Font.Name = "黑体" '本行代码可删除!
- End With
- .Execute , Format:=True, Replace:=wdReplaceAll
- End With
- .Content.Font.NameAscii = "Times New Roman"
- End With
- End Sub
复制代码 |