Pergunta

how can I enable highlight when mouse over into VBA? I write a marco into VBA, that after creating a new shape the shape should be enabled highlight when mouse over. Maybe with color?

Thank you argonist

Foi útil?

Solução 2

I found the simply way.

myshape.ActionSettings(ppMouseOver).AnimateAction = msoTrue

But I cannot change the color and the line size. That is enough for me. Thank you.

Outras dicas

Your macro would need to run on a specific event. So in Powerpoint you have options such as:

  • MouseDown
  • MouseMove
  • MouseUp

You can hit the F1 key to tell you exactly which event does what.
In VBA there is no event called 'MouseOver' so you need to improvise such as using a 'MouseMove' event to change the colour when you hover over it, and then maybe the pages 'MouseMove' event to change it back to the default colour when you move the mouse onto something else.
You should be able to find all of these events in the drop down list for the object in the Visual Basic window

Another option rather than using VBA is to play around with powerpoints animations and effects which may get you the same result.

Try this one on ActiveX picture attach in slide (code run in show mode)

'zmien_w_trybie_prezentacji - VBATools.pl
Private Sub Image1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Call kolor2(Image1)
End Sub

Sub kolor2(osh As Image)
    If osh.BackColor = 255 Then _
       osh.BackColor = 13998939 Else _
       osh.BackColor = 255
End Sub
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top