I have a VBS that finds the next track change in a word document and then presents a message box with the page number.
This loops through and it's not a problem, but what I was to do is add these 'CurPage' variables to a single array. So rather than msgbox 36 then msgbox 38 -- it is msgbox 36, 38 etc.
Also I need to work out end of file to exit the loop.
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