本示例在第一个窗口中判断选中的项是否为连接符,如果是则将线条设为绿色,否则设为浅蓝色。

With Windows(1).Selection.ShapeRange
    If .Connector Then
        .Line.ForeColor.RGB = RGB(100, 200, 10)
    Else
        .Line.ForeColor.RGB = RGB(100, 240, 240)
    End If
End With