|
- Sub test提取下划线单词到选区前后()
- Dim r As Range, s As Range, i$, j$, n&
- With Selection
- If .Type = 1 Then MsgBox "Not-Select!", 0 + 16: End
- Set r = .Range
- Set s = .Range
- With r.Find
- .ClearFormatting
- .Text = ""
- .Font.Underline = wdUnderlineSingle
- .Forward = True
- .MatchWildcards = True
- Do While .Execute
- With .Parent
- n = n + 1
- i = i & " " & .Text
- j = j & n & "." & .Text & " "
- .Text = Space(7)
- .SetRange Start:=.End, End:=s.End
- End With
- Loop
- End With
- .InsertBefore Text:=i & vbCr
- .Paragraphs(1).Range.ListFormat.ConvertNumbersToText
- .Characters(1).Delete
- Do While .Next Like "[!a-zA-Z]"
- .Delete
- Loop
- .Delete
- s.InsertAfter Text:="参考答案:" & j & vbCr
- End With
- End Sub
复制代码 |
评分
-
2
查看全部评分
-
|