I'd add that you want a little error trapping. There are a few oddball situations where this wlll throw errors (e.g. in slide sorter view, when the insertion cursor is between slides, no slide actually selected).
And if the user's in Notes Page view, this will put the rectangle on the notes page, not on the slide itself. You can check the view type and set it to something else if need be:
With ActiveWindow
If .View.Type = ppViewNotesPage Then
.ViewType = ppViewSlide
End If
End With
And out of politeness, you'd want to record the original view type and reset it once you're done.
Or better yet, just reference the slide directly:
Dim sld As Slide
Dim shp As Shape
Dim SlideIndex As Long
SlideIndex = ActiveWindow.View.Slide.SlideIndex
Set sld = ActivePresentation.Slides(SlideIndex)
Set shp = sld.Shapes.AddShape(Type:=msoShapeRectangle, _
Left:=50, Top:=50, Width:=100, Height:=200)
shp.Fill.ForeColor.RGB = vbBlue