Hi,

I created the macro which incrementally decreases the internal margins of shapes (by 0.1 cm.).

I wonder if there is any way to make this code go further and ignore the numbers which are smaller than 0.1 cm.

For example, if I set all the shape's margins to 0.26 cm I can only click twice and then the error raised “The specified value is out of range”. I would like to ignore the remaining 0.06 cm and set the value to 0 cm after the third click.

I would be more than grateful for any suggestions how to solve this!

PHP Code:
Sub Decrease_01cm_Shape()
   
With ActiveWindow.Selection.ShapeRange.TextFrame2
    
.MarginLeft = .MarginLeft 2.8346456693
    
.MarginRight = .MarginRight 2.8346456693
    
.MarginBottom = .MarginBottom 2.8346456693
    
.MarginTop = .MarginTop 2.8346456693
   End With
End Sub