A
anonymous
I have written the following code to center an object in a slide
Sub CenterBoth()
On Error GoTo CenterBothMsg
If IsNull(ActiveWindow.Selection.ShapeRange) Then
MsgBox "yup"
Exit Sub
End If
With ActiveWindow.Selection.ShapeRange
.Align msoAlignMiddles, True
.IncrementTop 105 / 2
.Align msoAlignCenters, True
.IncrementLeft 0
End With
CenterBothMsg:
MsgBox "Please Select A Picture To Center"
On Error GoTo 0
End Sub
Despite the on error statement in no picture is selected I still get
the following message
Run-time error '-2147188160 (80048240)':
Selection (unknown member) : Invalid request. Nothing appropriate is
currently selected.
Is there a way to supress this message and create a more user friendly
message?
Sub CenterBoth()
On Error GoTo CenterBothMsg
If IsNull(ActiveWindow.Selection.ShapeRange) Then
MsgBox "yup"
Exit Sub
End If
With ActiveWindow.Selection.ShapeRange
.Align msoAlignMiddles, True
.IncrementTop 105 / 2
.Align msoAlignCenters, True
.IncrementLeft 0
End With
CenterBothMsg:
MsgBox "Please Select A Picture To Center"
On Error GoTo 0
End Sub
Despite the on error statement in no picture is selected I still get
the following message
Run-time error '-2147188160 (80048240)':
Selection (unknown member) : Invalid request. Nothing appropriate is
currently selected.
Is there a way to supress this message and create a more user friendly
message?