Sub 図形_塗りつぶし()
'図形の塗りつぶしを自動設定 On Error Resume Next With Selection.ShapeRange.Line .Visible = msoTrue .ForeColor.ObjectThemeColor = msoThemeColorText1 .ForeColor.TintAndShade = 0 .ForeColor.Brightness = 0 .Weight = 0.25 End With
If Selection.ShapeRange.Fill.Visible <> msoTrue Then
If Selection.ShapeRange.Fill.ForeColor.ObjectThemeColor = msoThemeColorBackground1 Then With Selection.ShapeRange.Fill .Visible = msoTrue .ForeColor.RGB = RGB(255, 255, 0) '黄 .Transparency = 0 .Solid End With With Selection.ShapeRange.TextFrame2.TextRange.Font.Fill .Visible = msoTrue .ForeColor.RGB = RGB(0, 0, 0) '黒 .Transparency = 0 .Solid End With ElseIf Selection.ShapeRange.Fill.ForeColor.RGB = RGB(255, 255, 0) Then With Selection.ShapeRange.Fill .Visible = msoTrue .ForeColor.RGB = RGB(255, 0, 0) '赤 .Transparency = 0 .Solid End With With Selection.ShapeRange.TextFrame2.TextRange.Font.Fill .Visible = msoTrue .ForeColor.ObjectThemeColor = msoThemeColorBackground1 '白 .ForeColor.TintAndShade = 0 .ForeColor.Brightness = 0 .Transparency = 0 .Solid End With ElseIf Selection.ShapeRange.Fill.ForeColor.RGB = RGB(255, 0, 0) Then With Selection.ShapeRange.Fill .Visible = msoTrue .ForeColor.RGB = RGB(0, 176, 240) '青 .Transparency = 0 .Solid End With With Selection.ShapeRange.TextFrame2.TextRange.Font.Fill .Visible = msoTrue .ForeColor.RGB = RGB(0, 0, 0) '黒 .Transparency = 0 .Solid End With ElseIf Selection.ShapeRange.Fill.ForeColor.RGB = RGB(0, 176, 240) Then Selection.ShapeRange.Fill.Visible = msoFalse '透明 With Selection.ShapeRange.TextFrame2.TextRange.Font.Fill .Visible = msoTrue .ForeColor.RGB = RGB(0, 0, 0) '黒 .Transparency = 0 .Solid End With End If Else With Selection.ShapeRange.Fill .Visible = msoTrue .ForeColor.ObjectThemeColor = msoThemeColorBackground1 '白 .ForeColor.TintAndShade = 0 .ForeColor.Brightness = 0 .Transparency = 0 .Solid End With With Selection.ShapeRange.TextFrame2.TextRange.Font.Fill .Visible = msoTrue .ForeColor.RGB = RGB(0, 0, 0) '黒 .Transparency = 0 .Solid End With End If Selection.ShapeRange.SetShapesDefaultProperties
On Error GoTo 0
End Sub