|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
本帖最后由 duquancai 于 2016-6-4 00:32 编辑
没有优化代码,请测试
Option Base 1
Sub test()
Dim x() As Variant, y() As Variant, t As String, t1 As String, i%, j%, m%
Dim oPage As Page
i = ActiveDocument.ActiveWindow.ActivePane.Pages.Count
For Each oPage In ActiveDocument.ActiveWindow.ActivePane.Pages
t1 = oPage.Rectangles(1).Range.Text
ReDim Preserve x(i)
j = j + 1
x(j) = t1
Next
For m = 1 To i
ReDim Preserve y(i)
y(m) = x(i - m + 1)
t = t + y(m)
Next
Documents.Add.Content.Text = t
End Sub
|
|