Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Sub NextDocument()
Dim dc As Document, idx As Integer
idx = 1
For Each dc In Documents
If dc.Name = ActiveDocument.Name Then
If idx = Documents.Count Then
idx = 1
Else
idx = idx + 1
End If
Documents(idx).Activate
Exit Sub
End If
idx = idx + 1
Next
End Sub
So it would appear that the same code should work as an Excel macro but it doesn't seem to....ActiveWindow.Index is always 1 - for all workbooks...VBA Help said:The Windows collection for the Application object contains all the windows in the application
Dim rngWhatever As Range
Dim appWord As Word.Application
Dim wrdDoc As Word.Document
Dim rngWhatever As Range
Dim appWord As Word.Application
Dim wrdDoc As Word.Document
Dim rngWhatever As [b]Word[/b].Range
Dim rngYadda As Range
Sub Macro1()
If [i][b]Application[/b][/i].ActiveWindow.Index = [i][b]Application[/b][/i].Windows.Count Then
[i][b]Application[/b][/i].Windows(1).Activate
Else
[i][b]Application[/b][/i].Windows(ActiveWindow.Index + 1).Activate
End If
End Sub
=ACTIVATE.NEXT()
=RETURN()