Because floating objects are not inlineshapes.
Code:
Sub AddBorderToShape()
Dim oShp As Shape
On Error Resume Next
Set oShp = Selection.ShapeRange(1)
MsgBox Err.Number
If Err.Number <> 0 Then Exit Sub
With oShp
.Line.ForeColor.RGB = RGB(0, 0, 0)
.Line.Weight = 4
.Line.DashStyle = msoLineSolid
End With
End Sub