|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
供参考:
- Sub 分栏排列选择题答案()
- Dim Rng As Range, cTxt$, d%, nEnd%
- ActiveDocument.Range(0, 0).Select
- Selection.Find.ClearFormatting
- Selection.Find.Replacement.ClearFormatting
-
- With Selection.Find
- .Text = "^b"
- .Replacement.Text = ""
- .Forward = True
- .Wrap = wdFindContinue
- .Format = False
- .MatchCase = False
- .MatchWholeWord = False
- .MatchByte = True
- .MatchWildcards = False
- .MatchSoundsLike = False
- .MatchAllWordForms = False
- End With
- Selection.Find.Execute Replace:=wdReplaceAll
-
- ActiveDocument.Range.PageSetup.TextColumns.SetCount NumColumns:=1
-
- Selection.Find.Text = "A."
- On Error Resume Next
- Do
- ActiveDocument.Range(nEnd, nEnd).Select
- If Selection.Find.Execute = False Then Exit Do
- d = ActiveDocument.Range(0, Selection.Start).Paragraphs.Count
- nEnd = ActiveDocument.Paragraphs(d + 4).Range.End
- ActiveDocument.Range(Start:=nEnd, End:=nEnd).InsertBreak Type:=wdSectionBreakContinuous
- ActiveDocument.Range(Start:=Selection.Start, End:=Selection.Start).InsertBreak Type:=wdSectionBreakContinuous
- Set Rng = ActiveDocument.Range(Selection.Start + 1, nEnd)
- If Err <> 0 Then Exit Do
- cTxt = Rng.Text
- If Len(cTxt) < 65 Then
- Rng.PageSetup.TextColumns.SetCount NumColumns:=IIf(Len(cTxt) < 30, 4, 2)
- End If
- Loop
- End Sub
复制代码
|
评分
-
1
查看全部评分
-
|