Three ways:
1) Add an event object via the eventlist.addadvise method (See SDK for info)
for the visEvtCodeWinPageTurn of Application, Windows or Window object
(depending on what events you want to trap).
2) Add an event object via the eventlist.add method for similar as (1). I
have tried this method and it fails depending on what you want it to do, but
is simpler than addadvise.
3) Trap the WindowTurnedToPage event using WithEvents (for VB/VBA). The
simplest and least flexible method. Again see the SDK or Help.
One word of caution: while one would think this is a safe event to trap, I
have seen it come before Visio event flushing is complete when the user
deletes a page. In theory you can get into trouble if you trap events and
change stuff which causes other events, if it's before visio flushes some
event queues. I have crashed visio when doing that for the
BeforeWindowPageTurn event, because that is in the middle of a flush every
time. I haven't crashed it with the methods above.
-Hadriel
p.s. changing the page tab after that should be a simple matter of setting
the ActivePage object to the one you want, if you don't like the page the
user changed to.