Bonjour à tous,
Je recherche pour libre office calc un code macro afin d’agrandir une image lorsque je clique dessus, le but étant de pouvoir les laisser en miniatures lorsque je n’ai pas besoin de les voir.
J’ai un code qui rempli parfaitement cette fonction, mais il ne fonctionne que sous excel, alors si une bonne âme pouvait m’aider à le rendre compatible, ce serait très gentil.
D’avance merci
Ludo
Ci-dessous le code excel :
Private Sub Agrandir_image()
ActiveSheet.Shapes.Range(Array(Application.Caller)).Select
Selection.ShapeRange.ScaleHeight 2, msoFalse
Selection.ShapeRange.ScaleWidth 2, msoFalse
Selection.ShapeRange.ZOrder msoBringToFront
Selection.OnAction = "Diminuer_image"
ActiveSheet.Shapes(Application.Caller).TopLeftCell.Select
End Sub
Private Sub Diminuer_image()
ActiveSheet.Shapes.Range(Array(Application.Caller)).Select
Selection.ShapeRange.ScaleHeight 0.5, msoFalse
Selection.ShapeRange.ScaleWidth 0.5, msoFalse
Selection.ShapeRange.ZOrder msoSendToBack
Selection.OnAction = "Agrandir_image"
End Sub
Sub initialiser()
For Each Image In ActiveSheet.Shapes
If Image.Type = msoPicture Or Image.Type = msoLinkedPicture Then
Image.OnAction = "Agrandir_image"
End If
Next Image
End Sub