OK. I got a little carried away and was having too much fun with this. Try
this. Just assign the macro MoveMe to the Mouse Over action setting of the
button you want to have move out of the way. It will randomly move up, down,
left, or right each time the mouse goes over the button.
Sub RandomMove(oshp As Shape)
Dim rndNum As Integer
Randomize
rndNum = Int(4 * Rnd)
If rndNum = 0 Then
MoveMeRight oshp
ElseIf rndNum = 1 Then
MoveMeLeft oshp
ElseIf rndNum = 2 Then
MoveMeUp oshp
ElseIf rndNum = 3 Then
MoveMeDown oshp
End If
End Sub
Sub MoveMeRight(oshp As Shape)
If oshp.Left + oshp.Width + 5 > _
ActivePresentation.PageSetup.SlideWidth Then
oshp.Left = 0
Else
oshp.Left = oshp.Left + oshp.Width + 5
End If
End Sub
Sub MoveMeLeft(oshp As Shape)
If oshp.Left - oshp.Width - 5 < 0 Then
oshp.Left = ActivePresentation.PageSetup.SlideWidth - oshp.Width
Else
oshp.Left = oshp.Left - oshp.Width - 5
End If
End Sub
Sub MoveMeDown(oshp As Shape)
If oshp.Top + oshp.Height + 5 > _
ActivePresentation.PageSetup.SlideHeight Then
oshp.Top = 0
Else
oshp.Top = oshp.Top + oshp.Height + 5
End If
End Sub
Sub MoveMeUp(oshp As Shape)
If oshp.Top - oshp.Height - 5 < 0 Then
oshp.Top = ActivePresentation.PageSetup.SlideHeight - oshp.Height
Else
oshp.Top = oshp.Top - oshp.Height - 5
End If
End Sub