Actually, that could fail if your starting mins/max's are not 'extreme' enough for the coordinates you pass in the array.
There's a simple way to fix it though. Just set your mins/max's to match the first values in the array, then loop though the rest:
SmallestX = Shape(0).X
SmallestY = Shape(0).Y
LargestX = Shape(0).X
LargestY = Shape(0).Y
For I = 1 to Array Count( Shape( ) )
If Shape( I ).X < SmallestX
SmallestX = Shape( I ).X
EndIf
If Shape( I ).Y < SmallestY
SmallestY = Shape( I ).Y
EndIf
If Shape( I ).X > LargestX
LargestX = Shape( I ).X
EndIf
If Shape( I ).Y > LargestY
LargestY = Shape( I ).Y
EndIf
Next I