The only way I can find would be to write XSlideShowListener macro code. An example is at https://forum.openoffice.org/en/forum/viewtopic.php?f=10&t=31312.
I could help you figure this out, although on superuser.com, programming-related answers probably aren't what you were hoping for.