【发布时间】:2013-07-05 02:27:10
【问题描述】:
我有一个 VBS,它在 word 文档中查找下一个音轨变化,然后显示一个带有页码的消息框。
这会循环,这不是问题,但我要做的是将这些“CurPage”变量添加到单个数组中。所以不是 msgbox 36 然后是 msgbox 38 -- 它是 msgbox 36、38 等等。
我还需要解决文件结尾以退出循环。
Dim i As Integer
i = 0
'get us home
Selection.HomeKey Unit:=wdStory
Do
'find next change
WordBasic.NextChangeOrComment
'get current page
CurPage = Selection.Information(wdActiveEndAdjustedPageNumber)
MsgBox (CurPage)
'<Add CurPage value to array>
'<find out if we have reached the end of file, if so end loop>
i = i + 1
Loop Until i = 188
End Sub
【问题讨论】: