|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Sub shishi()
Dim p As Range, doc As Document, arr()
Set doc = ActiveDocument
doc.Bookmarks("\StartOfDoc").Select
Do
n = n + 1: ReDim Preserve arr(1 To n)
If n = 1 Then
Selection.MoveEnd 5, 10
Set p = Selection.Range
Set arr(1) = p.Duplicate
Else
p.Collapse 0: p.Select
Selection.MoveEnd 5, 10
Set p = Selection.Range
Set arr(n) = p.Duplicate
End If
MsgBox arr(n) '这个是正确。
Loop Until p.End = doc.Content.End
For i = LBound(arr) To UBound(arr)
MsgBox arr(i) '这个不能不行。
Next
End Sub
|
评分
-
1
查看全部评分
-
|