Sub CentrerImage()
' centre une image sélectionnée au milieu de la page peu importe sa position initiale
On Error GoTo erreur
Application.ScreenUpdating = False
' Si l'objet est un InlineShape on le converti en Shape
If Selection.Type = wdSelectionInlineShape Then
Selection.InlineShapes.Item(1).ConvertToShape
End If
' Si l'objet est un Shape on le centre par rapport à la page
If Selection.Type = wdSelectionShape Then
Selection.ShapeRange.RelativeHorizontalPosition = wdRelativeHorizontalPositionPage
Selection.ShapeRange.RelativeVerticalPosition = wdRelativeVerticalPositionPage
Selection.ShapeRange.Left = wdShapeCenter
Selection.ShapeRange.Top = wdShapeCenter
End If
erreur:
Application.ScreenUpdating = True
End Sub