第一个问题,请参: '* +++++++++++++++++++++++++++++
'* Created By I Love You_Word!@ExcelHome 2005-8-8 10:09:03
'仅测试于System: Windows NT Word: 10.0 Language: 2052
'№ 0003^The Code CopyIn [ThisDocument-ThisDocument]^'
'* -----------------------------Option Explicit
Sub Example()
Dim MyRange As Range, PosStart As Long, PosEnd As Long
With Selection
PosEnd = .Paragraphs(1).Range.End
Set MyRange = ActiveDocument.Range(0, PosEnd)
If MyRange.Paragraphs.Count < 3 Then
MsgBox "光标所在位置的段落数不足3!"
Else
PosStart = .Paragraphs(1).Previous(2).Range.Start
Set MyRange = ActiveDocument.Range(PosStart, PosEnd)
MyRange.Select
End If
End With
End Sub
'----------------------第二个问题,可以使用查找功能实现,但全文字体颜色必须一致。 此功能,可以参考: http://club.excelhome.net/viewthread.php?tid=83670 |