本示例在活动窗口中判断选定的图形是否为图片,如果是则旋转45度,否则旋转90度。

With ActiveWindow.Selection.ShapeRange
    If .Type = ksoPicture Then
      .Rotation = 45
    Else
      .Rotation = 90
    End If
End With