|
楼主,你是不是想——跳过表格,只选择表格外文字?请试试本坛大神 sylun 老师 的代码:
- Sub SkipTable()
- 'code by sylun
- Dim r(), n As Long
- With ActiveDocument
- ReDim r(.Tables.Count + 1)
- If .Tables.Count = 0 Then
- Set r(1) = .Content
- Else
- For n = 1 To .Tables.Count
- If n = 1 Then
- Set r(n) = .Range(0, .Tables(n).Range.Start)
- Else
- Set r(n) = .Range(.Tables(n - 1).Range.End, .Tables(n).Range.Start)
- End If
- Next
- Set r(n) = .Range(.Tables(n - 1).Range.End, .Content.End)
- End If
- End With
- For n = 1 To UBound(r)
- With r(n)
- .Select
- Selection.Font.ColorIndex = wdRed
- End With
- Next
- End Sub
复制代码 |
|